I would like to write a C prg. which should do exactly what my Perl prg. does. Here is what i need. There is a file called "list.txt" which has following records:
1=bill gates=MicroSoft
2=Sam walton=Walmart
3=Steve Jobs=Apple
4=Larry w=Oracle
Now prg. should generate/print a new record each time it gets executed. To be more clear it should generate random number between 1 to 4 (since i am giving eg. of 4 records)
and should print record details corr. to that number. For example If it generates random no. 2 , it should read the file and print details of record that corr. to 2 which is in this case is : 2=Sam walton=Walmart
Any help . Greatly appreciated.
regards
sk
1=bill gates=MicroSoft
2=Sam walton=Walmart
3=Steve Jobs=Apple
4=Larry w=Oracle
Now prg. should generate/print a new record each time it gets executed. To be more clear it should generate random number between 1 to 4 (since i am giving eg. of 4 records)
and should print record details corr. to that number. For example If it generates random no. 2 , it should read the file and print details of record that corr. to 2 which is in this case is : 2=Sam walton=Walmart
Any help . Greatly appreciated.
regards
sk