I am currently working on a project to develop a library in C. I finally found a mistake that I did not expect and it's hard to explain.
I thought we would get the same result but not: string2 is greater than string1. Is there any difference between these 2 syntax ... Thank you for your helpCode:# include <stdlib.h> # include <stdio.h> int main () ( char * string1 = "text", string2 [] = "text"; printf ( "% d", sizeof (string1)); printf ( "% d", sizeof (string2)); return 0; )
Bookmarks