阅读背景:

使用istream读取空终止字符串的最简单方法?

来源:互联网 

I have an istream and i need to read exactly a specific amount of bytes BUT i dont know the length of it. It is null terminated. I was thinking i could either 1) Write a loop and read one byte at a time 2) Tell it to return me a buffer or string which starts now until a certain byte (0 in this case). or 3) Read into a buf exactly one byte at a time and check it for 0 and append it to string if it isnt.I have an istream and i need to read exactly a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: