#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char string[] = "october"; // 7 letters
strcpy(string, "september"); // 9 letters
printf("the size of %s is %d and the length is %d\n\n", string,
sizeof(string), strlen(string));
return 0;
}
Sortir:
$ ./a.out
the size of september is 8 and the length is 9
Y a-t-il quelque chose qui ne va pas avec ma syntaxe ou quoi?