Originally posted by sam robert:
thanks guys ...but i am still not clear as to how do i store the read part in a vector ....please explain that ....i appreciate it....
sam, if you want to keep all the lines in a vector, you can modify somkit's code as the following... As Pradeep mentioned, if you are directly printing the contents of the file to the console screen, you don't need a vector to store them... But if you want to use them in the future, you might need it...
Hope it helps...

Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0