Printing out char elements in an array from user input
First post on this website, I'm a newbie to C Programming. I've got my head around data types.
I want to be able to ask the user to input a string of text and store it in an array. I have created the following test program to see if my code is able to display the 3rd char element of what the user had input.
What this program does instead is crash on me, any idea why?
printf("enter some text");
scanf ("%s", string);
Also since I've declared the number 10 in the string, does this mean that my program will indeed accept only 9 char values? (*-1)