Programming tutorials online .NET, Java, C++, Visual Basic, and More
 

Home
.NET Tutorials
General Programming Tutorials
Community/Forums
Site Extras

 

C/C++ Forum
 

Open forum for posting questions or comments regarding C/C++.


VIEW REPLIES | POST REPLY
Posted By: richie2021   6/8/2007 8:44:00 AM
 
#include
#include
int main()
{
struct {
char origin[50];
char destination[50];
char flight[10];
char aircraft[3];
char days_of[7];
char departure[4];
char arrival[4];
char begin_date[10];
char end_date[10];
}flight_details[1679];
FILE *fp;
fp=fopen("iaschedule-07(edit).csv","r");
char buf[50];
int i;
while( fgets(buf,sizeof(buf),fp) != NULL)
{
strcpy(flight_details[i].origin, strtok(NULL,","));
strcpy(flight_details[i].destination, strtok(NULL,","));
strcpy(flight_details[i].flight, strtok(NULL,","));
strcpy(flight_details[i].aircraft, strtok(NULL,","));
strcpy(flight_details[i].days_of, strtok(NULL,","));
strcpy(flight_details[i].departure, strtok(NULL,","));
strcpy(flight_details[i].arrival, strtok(NULL,","));
strcpy(flight_details[i].begin_date, strtok(NULL,","));
strcpy(flight_details[i].end_date, strtok(NULL,","));
++i;
}
printf("print details\n");
for (int j=0; j {
printf("Origin : %s", flight_details[j].origin);
printf(", Destination : %s\n",flight_details[j].destination);
}
return 0;
]

I am new to C, I get a list of warnings and errors saying. one of the warnings is, incompatible implicit declaration of built-in function strcpy.

could someone please help me clean this up I think i have alt of syntax problems.


REPLY PREVIEW POSTED BY WHEN
#include #include #in... Telnet 6/8/2007 10:16:00 AM


 
Sign In
Email
Password
  Forgot my password

Search

Featured Book

Introducing Microsoft .Net, Third Edition ($19.79)
Introducing Microsoft .Net, Third Edition


Featured Software

Microsoft Visual Studio Standard 2005 ($249.99)
Microsoft Visual Studio Standard 2005





 
© 2022 Ammastore.org
All Rights Reserved
COMPUTER SCIENCE HOMEWORK | Privacy/Disclaimer