Question
How to declare a string variable in C?
Background
In my quest to learn the basics of c, I am trying to port on
The int your putting is not a string, a string looks like "char myString[20]". Not like "int name", that's an integer and not a string or char. This is the code you want:
int main(int argc, const char * argv[])
{
char name[9999];
printf("What is your name?\n");
scanf("%s", name);
system("cls");
printf("Your name is %s", name);
return 0;
}