S
slickn_sly
<code>
line = 1;
while( !feof( infile ) )
{
if( line = 2 )
{
fgets( name, 25, infile );
}
else if( line = 3 )
{
fgets( address, 80, infile );
strcat( tempaddress, address );
if( strcmp( address, "?" ) == 0 )
{
line = 4;
}
}
else if( line = 4 )
{
fgets( yearofbirth, 5, infile );
}
else if( line = 5 )
{
fgets( telno, 15, infile );
}
line++;
printf( "%s%s%s%s", name, address, yearofbirth, telno );
addRecord( rptrp , name, address, atoi(yearofbirth), telno
);
}
</code>
I wonder if someone can help me out. For some reason, this while loop
doesn't update. line is always set to 1. i'm trying to get each line
and store it in each array.
Posted at: http://www.groupsrv.com
line = 1;
while( !feof( infile ) )
{
if( line = 2 )
{
fgets( name, 25, infile );
}
else if( line = 3 )
{
fgets( address, 80, infile );
strcat( tempaddress, address );
if( strcmp( address, "?" ) == 0 )
{
line = 4;
}
}
else if( line = 4 )
{
fgets( yearofbirth, 5, infile );
}
else if( line = 5 )
{
fgets( telno, 15, infile );
}
line++;
printf( "%s%s%s%s", name, address, yearofbirth, telno );
addRecord( rptrp , name, address, atoi(yearofbirth), telno
);
}
</code>
I wonder if someone can help me out. For some reason, this while loop
doesn't update. line is always set to 1. i'm trying to get each line
and store it in each array.
Posted at: http://www.groupsrv.com