|
|
|
|
|

| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 17 Feb 2008 21:38:57 IST
|
|
|
Write a program to read the text file "NAMES.TXT" that contents students's names and display them on the console along with lengh of every name present in the file .
|
The one man Dynasty !!!!!!!!
|
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 17 Feb 2008 21:43:00 IST
|
|
|
gimme 5 minutes..........
|
............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 17 Feb 2008 21:48:44 IST
|
|
|
#include<fstream.h> #include<conio.h> #include<string.h> void main() { fstream ob ( "NAMES.TXT" , ios::in|ios::out);
char str[50]; int len;
while ( ! ob.eof () ) { ob.getline( str , 50 ) ; len = strlen ( str ); if ( !ob.eof() ) { cout<<" The string is : "<<str<<endl; cout<<" The length of string is : "<<len<<endl; } }
ob.close(); getch(); }
this should work ........if not then do let me know.......
|
............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
|
this reply: 10 points
(with 2 
in 2 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 17 Feb 2008 21:51:26 IST
|
|
|
I also think the same . But after cout you put two double quotes .he he lol.. gr88888 job .
|
The one man Dynasty !!!!!!!!
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
![[Post New]](/templates/default/images/icon_minipost_new.gif) 17 Feb 2008 21:52:54 IST
|
|
|
ahhh yea.....in a hurry........now edited.......
|
............................................................................................................................................................................................
There's Light at the end of every Tunnel, so KEEP MOVING....
Best of luck to all my mates....
............................................................................................................................................................................................
|
this reply: 0 points
(with 0 
in 0 votes ) [?]
|
|
You have to be logged on to rate
|
|
|
|
|
|
|
|
|
|