#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
constchar* arr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
constchar arr2[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
void fun(void) {
printf("Size of arr %lu\n",(unsignedlong)sizeof(arr));
printf("Size of arr2 %lu\n",(unsignedlong)sizeof(arr2));
printf("Length of arr %lu\n",(unsignedlong)strlen(arr));
}
int main(void) {
fun();
return 0;
}
Just wondering: Should not be the size of arr2 4 bytes, too? Because arr and arr2 are both pointers to a string. On my machine arr2 is length of string incl. null terminator...