小编Luc*_*urt的帖子

与 Java 的 java.io.FileInputStream.read() 等效的 C++ 是什么?

如何将以下 Java 行转换为 C++ 代码?

 FileInputStream fi = new FileInputStream(f);
 byte[] b = new byte[188];
 int i = 0;
 while ((i = fi.read(b)) > -1)// This is the line that raises my question.
 {
 // Code Block
 }
Run Code Online (Sandbox Code Playgroud)

我正在尝试运行以下代码行,但结果是错误。

 ifstream InputStream;
 unsigned char *byte = new unsigned char[188];
 while(InputStream.get(byte) > -1)
 {
 // Code Block
 }
Run Code Online (Sandbox Code Playgroud)

c++ java inputstream

1
推荐指数
1
解决办法
2106
查看次数

标签 统计

c++ ×1

inputstream ×1

java ×1