Quote Originally Posted by brightmatter View Post
It was my impression that sizeof didn't lie so much as it just includes the null terminator at the end of a C-style char array
Try this:
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main (void) {
	char *sp = malloc(12);

	strcpy(sp,"hello world");
	printf("%d %d\n",sizeof(sp),strlen(sp));
        free(sp);

	return 0;
}