Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

structure troubles (haha, sounds like a sitcom)

Status
Not open for further replies.

zanza

Programmer
Feb 18, 2002
89
US
can you tell me the error here? gcc (im using linux) says i have more than one type def in the struct declaration... i dun see how but then again, thats why im learning

#include<stdio.h>

int count;

struct entry
{
char fname[19];
char lname[19];
char phnum[10];
}

struct entry list[3];

int main(void)
{
for(count=0; count<4; count++)
{
printf(&quot;\n\nEnter Name of Person %d\n>>&quot;, count+1);
scanf(&quot;%s %s&quot;, list[count].fname, list[count].lname);
printf(&quot;\nEnter Phone Nmber (w/ hyphen)\n>>&quot;);
scanf(&quot;%s&quot;, list[count].phnum);
}

for(count=0; count<4; count++);
{
printf(&quot;\nName: %s %s\t\tPhone: %s\n&quot;, list[count].fname, list[count].lname, list[count].phnum);
}

return 0;
}
žÅNžÅ
 
you have missed a semi colon after your structure definition..
 
i hate the semi colon. i really do. it gives me headaches every day. grr žÅNžÅ
 
Spoken like a recent convert to c from VB. ______________________________________________________________________
TANSTAAFL!
 
haha, yeah... sad but true. i was told &quot;learn the basics in basic&quot; žÅNžÅ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top