#include <stdio.h>
#include <string.h> /* provides strlen() prototype */
#define PRAISE "this is a test test test test."
int main(void)
{
char name[40];
printf("What's your name? ");
scanf("%s", name);
printf("Hello, %s. %s/n", name, PRAISE);
printf("Your name of %zd letters occupies %zd memory cells./n", strlen(name), sizeof name);
printf("It has %zd letters ", strlen(PRAISE));
printf("and occupies %zd memory cells./n", sizeof PRAISE);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266489.html