DESCRIPTION:
I'm working on a image editing program for school and can't seem to get rid of this error message. The program reads a ppm file, modifies it, and outputs a modified ppm file.
ERROR MESSAGE:
Error C2679 binary '>>': no operator found which takes a right-hand operand of type 'std::vector>,std::allocator>>>' (or there is no acceptable conversion)
RELEVANT CODE:
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
ifstream fin;
fin.open(infile);
if (fin.fail()) {
cerr << "Error opening input file '";
cerr << infile << "', exiting!" << endl;
return -1;
}
string magic;
int cols, rows, maxColor, red, green, blue, COLORS = 3;
fin >> magic >> cols >> rows >> maxColor;
// TODO: read in columns/rows/depth header info; make a data structure
// rows x columns x 3 integers.
vector<vector<vector<int>>> photo(rows, vector<vector<int>>(cols, vector<int>(COLORS)));
// TODO: read all of the image data into data structure.
for (int r = 0; r < rows; r++) {
for (int c = 0; c < cols; c++) {
for (int i = 0; i < 3; i++) {
fin >> photo[r, c, i];
}
}
}
// The error is under the last ">>" between fin and photo.
Thanks in advance for your help everyone!!
Aucun commentaire:
Enregistrer un commentaire