+ 1

pointers

int a[5] = {22, 33, 44, 55, 66}; int *ptr = NULL; ptr = a; printf("%d %x\n", *ptr, ptr); ptr++; printf("%d %x\n", *ptr, ptr); ptr += 3; printf("%d %x\n", *ptr, ptr); ptr--; printf("%d %x\n", *ptr, ptr); ptr -= 2; printf("%d %x\n", *ptr, ptr); In this case , Can i use '0' (zero) instead of 'NULL'.

8th Oct 2020, 12:59 PM
Pavin Raviselvam
2 Respostas
+ 4
Yes you can.
8th Oct 2020, 2:10 PM
Sonic
Sonic - avatar
+ 2
Ipang is right.
8th Oct 2020, 2:11 PM
Sonic
Sonic - avatar