The ultimate answer to a sizeof and char arrays question:

char test1[100]; char *test2 = (char*)malloc(100);

Node++ server is trying above code live and says this:

sizeof(test1) = 100 sizeof(test2) = 8

Don't forget:

free(test2);


Copyright © 2018–2021 Jurek Muszyński