Hi,
I have the following:
Code:function (char *message) { printf("sizeof(message) is: %d", sizeof(message)); printf("strlen(message) is: %d", strlen(message)); }
And I get the following at runtime:Code:char line_buf[300]; fgets(line_buf, sizeof(line_buf), stdin); // message entered at stdin: "the cat sat" function(line_buf);
sizeof(message) is: 4
strlen(message) is: 12
Why is the sizeof(message) returning 4 and how do you correct this?
Thanks.