我想按3行值讀取我的數組行。所以,當我恢復3個值把我的矩陣等等...按行讀取數組3行值3個值
for(int i=0; i<_height; i++) {
for(int j=0; j<_width; j++) {
result = ifile.get();
(image)[i][j]= (int)result;
// Display the array which contains data
cout << (image)[i][j] << " ";
}
cout << endl;
}
而你的問題其實是? –
如果您的文件包含文本格式的值,則可能需要使用'ifile >>結果;'。 –
我該如何做到這一點,通過3個值逐行檢索3個值? – Rayan958