Solved

Parse error

Posted on 2004-08-22
1
235 Views
Last Modified: 2010-04-15
Hello. I am trying to store 5 sports names in a sequence but I am getting a parse error on the "for" line? I can not figure it out? Thanks

#include <stdio.h>
#include<string.h>
int main()

{
   char sports [5][15];
   
    strcpy(sports[0],"tennis");
    strcpy(sports[1],"football");
    strcpy(sports[2],"basketball");
    strcpy(sports[3],"baseball");
    strcpy(sports[4],"gymnastics");
 
     for(int i=0; i<5; i++)
{        
printf("%s\n",sports[i]);
printf("%s\n",sports[i]);
printf("%s\n",sports[i]);
printf("%s\n",sports[i]);
printf("%s\n",sports[i]);
printf("exiting...\n");  

}
getch();
return 0;                          
}          
0
Comment
Question by:RebeccaFusco
1 Comment
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 11865427
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question