char name[20];
strcpy(name,"incredible hulk");
printf("%s\n",name);
What does that represent?
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.
Sign up to join this communityThat's a non-alpha ASCII value that is attempting to be printed. If you really want to know what it is, try printing it as an integer. Something along the lines of printf("the char ascii value is %i\n", name[0])
.
However, you have another issue. You declared name as a char array without giving it a size and without initializing it with data when declared. The compiler needs to know the size of the array when it is declared. With no size, you're playing with unknown data.
If this answers your question, please click on the check to accept. Let's keep up on forum housekeeping. ;-)