Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include using namespace std; class RGB { public: unsigned int r,g,b; RGB(){ r = 0, g = 0, b = 0; } RGB(unsigned int

#include #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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PostgreSQL Up And Running A Practical Guide To The Advanced Open Source Database

Authors: Regina Obe, Leo Hsu

3rd Edition

1491963417, 978-1491963418

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago