Hi, I am working on a program right now that will take in a .pgm file, and output "test" if it successfully does it. I have an image.h file that creates a class, an image.cpp file that holds the code to output "test", and the main.cpp which takes in the file itself and outputs test.
the image.h code looks like this:
class PGM {
public:
string title; //the title. P2, P3, P4, etc
string comment; //the comment inside the PGM file
int x_val; //used for the x-axis
int y_val; //will be used for the y-axis
int tolerance; //how many numbers will be used
PGM(stringstream v);
};```
the image.cpp file has this in it:
```c++
//constructor for reading PGM image
PGM::PGM(stringstream v) {
if (title.compare("P2") != 1) { //if it doesn't equal x..
cout << "You have entered the wrong file!\n";
}
else {
cout << "test\n";
}
}```
the main file is simple, and looks like this:
```c++
int main() {
int val;
ifstream infile("pgm.pgm");
stringstream sstream;
PGM m(sstream);
}```
my issue arises on the PGM m(sstream) chunk in main.cpp. It displays the code that you see in the provided screenshot, and I have no idea what this means. I am new to c++ so this is a completely new wacky issue for me. I know the code has some errors in it too at the moment but my main issue is why the error in the picture is showing up. any help would be appreciated.