C2061 Identifier Error

Hey Gent's. I am getting a C2061 in VS and I don't know why and was looking for some help. I am working on load and saving images from a file


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// 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

using namespace 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
Last edited on
which lines are 30 and 32 ? surely not #include and .....
Sorry, lines 40 and 42. The p is caught by the compiler and gives the C2061 Error.
Last edited on
well, where is p declared?
That's a good question and the answer quite obvious.
Thanks.
Topic archived. No new replies allowed.