string - Concerning C++ input and output -
string - Concerning C++ input and output -
i've designed programme can encrypt 26 english language letters.
here's how i'm handling input. i'm reading text file , stores in string.
ifstream l; string str1; char ch; l.open("tobecoded.txt"); while(il.get(ch)) str1.push_back(ch);
however, it's inefficient, if want read different file, have alter name in codes create work. there dynamic way so? drag file or type address of file during run time?
by way, have improve way read txt string? 1 'seems' slow.
you can utilize istream getline instead
http://www.cplusplus.com/reference/istream/istream/getline/
c++ string
Comments
Post a Comment