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

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -