0
sizeof operator using pointers
#include<stdio.h> #include<string.h> int main() { char a[]="Access\0"; char b[]="Access"; char *p="Access\0"; char *q="Access"; if(p==q) { printf("\n"); printf("Access 1"); } if(sizeof(a)==sizeof(b)) { printf("\nAccess 2"); } if(sizeof(p)==sizeof(q)) { printf("\nAccess 3"); } if(strlen(a)==strlen(b)) { printf("\nAccess 4"); } if(strlen(p)==strlen(q)) { printf("\nAccess 5"); } return 0; }
3 Answers
+ 8
U should try yourself in playground
0
Anyone gave the output of this code ??
0
And how this code work ??