Wan Andii
2009-11-17 06:48:04 UTC
Hello Group,
I have a program that reads integers from an external data file. I'm
trying to figure out how to get the result in
reverse order. For eg., if file contains 1,2,3,4 then I'd like to get
the output 4,3,2,1. Thanks in advance.
Wan
int main()
{
FILE *f;
int c[20];
f=fopen("C:\File.text","r");
if (!f)
return 1;
while (f!=NULL)
{
printf("%s",c);
}
fclose(f);
return 0;
}
I have a program that reads integers from an external data file. I'm
trying to figure out how to get the result in
reverse order. For eg., if file contains 1,2,3,4 then I'd like to get
the output 4,3,2,1. Thanks in advance.
Wan
int main()
{
FILE *f;
int c[20];
f=fopen("C:\File.text","r");
if (!f)
return 1;
while (f!=NULL)
{
printf("%s",c);
}
fclose(f);
return 0;
}