How would I extract a string from an input file? Just need to know what function to use. For example in this line:
abcdefghijklmnopqrst
Need to extract "klm" into an array.
How would I extract a string from an input file? Just need to know what function to use. For example in this line:
abcdefghijklmnopqrst
Need to extract "klm" into an array.
Use the memberfunction getline in cin. This has been covered several times. Make a Search here
P.S if you are using MSVC there is a bug in the header files for getline. Solution: a search again
01000111011011110110111101100100 011101000110100001101001011011100110011101110011 01100100011011110110111001110100 01100011011011110110110101100101 01100101011000010111100101110011 0110100101101110 01101100011010010110011001100101
Good things donīt come easy in life!!!
One solution is std::getline().
string sInput;
std::getline(cin, sInput);
size_t nFind = 0;
if ((sInput.find("klm")) != sInput.npos)
string sKey = sInput.substr(nFind, 3);
Kuphryn