What am I missing? GetLine function (C++) -
string getline() { char parameter[26] = {null}; infile.getline (parameter,26,' '); return parameter; }
now example of input file looks this:
~in.txt~
bac bca(space after last a)
~end file~
i have have space after or else function line won't work. there way not have space after , still work?
i have 26, because input line have 26 letters in it.
i need have them separated have because how use it:
string in, post; in = getline(); post = getline();
thanks suggestions on this, small chunk of code program i'm still working on. wanna cover bases because professor testing program own input file , don't know if input file end space.
this kind of silly redundant function, , don't know why call "getline", here ya go:
string getline() { string s; infile >> s; return s; }
Comments
Post a Comment