+ 8

Pointer to string

char* ptr="sololearn" cout<<*(ptr+5); what does it mean?

6th Dec 2017, 11:43 AM
I'm_Groot
I'm_Groot - avatar
2 Respostas
+ 1
You can think of it as a index of array. *(ptr + 0) and ptr[0] are same expressions.
6th Dec 2017, 12:02 PM
Selcuk
Selcuk - avatar
+ 5
@selcuk tq
6th Dec 2017, 12:10 PM
I'm_Groot
I'm_Groot - avatar