![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
File I/O reading a printing any line from a certain file.Hello, pretty new to programming, my problem is I have to write a program that opens a text file 100 lines long and be able to extract any line of the text file and print it on the screen.
I am able to open the file, and query the user for what line to print but im not sure how to use the getline() function to print it as a string. If my text file is named work.txt and I want to print line 50 of the text file how would I do this? |
|
#2
|
||||
|
||||
Re: File I/O reading a printing any line from a certain file.Read the file until you read line 50. Then output it.
__________________
Age is unimportant -- except in cheese |
Recent GIDBlog
Writing a book by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 07:44 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 10:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 11:28 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 02:26 |
| read specified range of lines from file | etron | C Programming Language | 8 | 18-Feb-2004 08:04 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The