hi i am trying to print out string are this sysntax wrong is this how i declare [I] or do i use int iam a beginner just trying to experiment
Code:char scores[50], i; printf("enter name"); scanf("\n%s", scores[i]); printf("\n%s",scores[i]);
hi i am trying to print out string are this sysntax wrong is this how i declare [I] or do i use int iam a beginner just trying to experiment
Code:char scores[50], i; printf("enter name"); scanf("\n%s", scores[i]); printf("\n%s",scores[i]);
Your syntax is fine. What is wrong is that you should pass scores, not scores[i] to scanf and printf. In fact, you should not use i because it has not been initialised.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)