Is there any function or way to read from a stream a specific number of characters and flush the stream ?
ex.
Need to read only 6 characters into string test
Input : blablablablabla
test : blabla
Thanks
Printable View
Is there any function or way to read from a stream a specific number of characters and flush the stream ?
ex.
Need to read only 6 characters into string test
Input : blablablablabla
test : blabla
Thanks
Use a for loop, reading in 1 char at a time into the string, or read in the entire string and truncate it to the desired length.
http://msdn2.microsoft.com/en-us/lib...69(VS.60).aspx - read could specify nCount
http://msdn2.microsoft.com/en-us/lib...60(VS.60).aspx - get could specify nCount
http://msdn2.microsoft.com/en-us/lib...61(VS.60).aspx - getline could specify nCount
http://msdn2.microsoft.com/en-us/lib...62(VS.60).aspx - ignore - could specify ncount and delimiter
Are you sure you have read istream spec and havn't found anything matching your needs?