#include <string.h>
#include <stdio.h>
void load_buffer(char *buffer);
int main()
{
char buffer[100]="\0";
printf("buffer size: %d\n", sizeof(buffer));
load_buffer(buffer);
return 0;
}
void load_buffer(char *buffer)
{
printf("sizeof(buffer): %d\n", sizeof(&buffer));
}
Result
buffer size: 100
sizeof(buffer): 8
Reference:
0 意見:
張貼留言