sizeof operator using pointers | SoloLearn: Learn to code for FREE!

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; }

11/9/2020 6:23:09 AM

Rohit Upadhyay

4 Answers

New Answer

+8

U should try yourself in playground

+1

Rohit Upadhyay, I can see from your profile that you have not started any courses. you couldn't even be bothered to paste the code into the code playground and run it to obtain the output. SoloLearn is not a homework completion service.

0

Anyone gave the output of this code ??

0

And how this code work ??