Question
#include #include using namespace std; class RGB { public: unsigned int r,g,b; RGB(){ r = 0, g = 0, b = 0; } RGB(unsigned int
#include
using namespace std;
class RGB { public: unsigned int r,g,b; RGB(){ r = 0, g = 0, b = 0; } RGB(unsigned int red, unsigned int green, unsigned int blue){ r = red; g = green; b = blue; }
unsigned int getred(){ return r; } unsigned int getgreen(){ return g; } unsigned int getblue(){ return b; }
};
class Imageppm: public RGB { public: unsigned int h,w,pixmap; Imageppm(unsigned int height, unsigned int width) {
h = height; w = width;
pixmap = RGB[h]; for(unsigned int i = 0; i < w; i++){ pixmap[i] = RGB[w]; } } void writeppm(string filename){ ofstream out(filename.c_str()); out << "P3 " << endl; out << "Created by " << endl; out << h << " " << w << endl; out << 255 << endl; out << " " << endl; for(int i = 0; i < h; h++){ for(int k = 0; k < w; k++){
} } }
};
int main() {
return 0; }
****************help c++ LINE 42 EXPECT PRIMARY EXPRESS BEFORE 44 INVALID TYPE UNSIGNED INT FOR ARRAY SUBSCRIP THANKS
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started