// hear is the header file
class image
{
public:
image();
image(string filename);
~image();
void createNewImage(int width, int height);
bool loadImage(string filename);
void saveImage(string filename);
pixel** getPixels(); //return the 2-dimensional pixel array
int getWidth(); //return the height of the image
int getHeight();//return the height of the image
void viewImage(CImage* myImage);
private:
void pixelsToCImage(CImage* myImage);
pixel** pixels; // pixel data array for image
int width, height;// stores the image dimensions
};
// here is the main
#include "stdafx.h" //needed for the Windows display
#include <cstdlib>
#include <string>
#include <fstream> // allow file in and output
usingnamespace std;
#include "globals.h" //some global variables are included here
#include "image.h" //includes the image class
........
image* displayImage() // this function should return a pointer to the image
// object that is loaded from a file.
{
int counter = 0;
image** ptr = NULL;
image myImage;
ptr = new p*[ myImage.getHeight() ];
for ( counter = 0; counter < myImage.getHeight(); counter++ )
ptr[ counter ] = new p[ myImage.getWidth ];
return ptr[ counter ];
}
I am getting a C2106 identifier error on line 40 and 42 and I don't know why.
Any help would be appreciated.
Thanks