hi all
this is my code
i have this text file with users and if from 1 to 10 , and all the name is in same lengthCode:#include <iostream> #include <fstream> using namespace std; int main () { char a ; int length ; ifstream infile ; ofstream outfile ; infile.open("hm.txt",ios::in) ; outfile.open("output.txt" , ios::out); infile.unsetf(ios::skipws); int a1; cout << " please enter the ID " <<endl; cin>> a1; infile>> a ; while ( ! infile.fail()) { outfile<< a; infile.seekg(0,ios::cur); infile >> a ; } infile.close(); outfile.close(); }
the user should enter an ID from 1 to 10 and then the app should search for the id and if it found some thing it should print the user of the ID without without id ..Code:1 ken1 2 ken2 3 ken3 4 ken4 5 ken5 6 ken6 7 ken7 8 ken8 9 ken9 10ken10
how i can do it ?????
thanks in advance


Reply With Quote

Bookmarks