/* hello.c - slightly more advanced than the typical hello world program * asks for user to enter name, then prints Hello * by R. Teather for COSC 2P13, Spring 2007 */ #include int main() { //a string to hold our name char strName[20]; printf("Please enter your name: "); //note that the & is optional here, because arrays actually are already memory addresses //the %s is the format string code for "string" scanf("%s", &strName); printf("Hello %s\n", strName); return 0; }