void CountLine( ) { char line[80]; int Count=0; ifstream fin (“NOTES.TXT”); while(!fin.eof()) { fin.getline(line,80,‘\n’)) if (line[0]== ‘A’||line[0]==’T’) Count++; } cout<<"There are "<<Count<<" Lines in file to start with a letter T or t."<<endl; fin.close( ); } void main() { CountLine(); }
No comments
Post your comments