operator ++ for char data type

i saw a code, it was writen:
1
2
char x[15]="data00.dat";
++x[5];

i don't understand ++x[5]; operator
can you help me to understand this code?
thanks!!!
That increments the 6th character in the array so the result would be
"data01.dat"
thanks!!!
is this follow rule?
if it witen : ++x[6], the result would be ...?
1
2
char x[15]="data00.dat";
++x[6];


you're left with "data00/dat"

This is because the period '.' is 0x2E in ASCII, and the slash '/' is 0x2F.

Try:
1
2
if('.' == 0x2E) // this will be true
if('/' == 0x2F) // as will this 
Last edited on
Last edited on
Topic archived. No new replies allowed.