- Jan 1, 2001
- 4,474
- 0
- 0
If anybody can help me, I would appreaciate it.
command line C++
I have character array of 5, and I want to either allow a user to input as many character and discard anything after five bytes, append the 5 with \0 or stop the user the from input more than 4 characters.
ie
char temp [5];
cout <<"please input your your information : "<<"\n";
//user types garble, but i only want 4 characters and null appended;
std:fstream.write(temp,4);
command line C++
I have character array of 5, and I want to either allow a user to input as many character and discard anything after five bytes, append the 5 with \0 or stop the user the from input more than 4 characters.
ie
char temp [5];
cout <<"please input your your information : "<<"\n";
//user types garble, but i only want 4 characters and null appended;
std:fstream.write(temp,4);