Advertisement

classes->conversion correct?

Started by May 06, 2002 08:17 AM
1 comment, last by edwinnie 22 years, 7 months ago
okie i seriously dunno whether my own conversion is correct or not...i am trying to convert Mr LaMothe's struct engine to class type engine. this is for the header file, is a constructor necessary here? or must i call a default constructor, coz i dun find any data members to add into the constructors.
          
// class for bitmaps .BMP file

class BITMAP_FILE
{
public:

BITMAPFILEHEADER bitmapfileheader;  // this contains the bitmapfile header

BITMAPINFOHEADER bitmapinfoheader;  // this is all the info including the palette

PALETTEENTRY     palette[256];      // we will store the palette here

UCHAR            *buffer;           // this is a pointer to the data


/*
//default constructor
BITMAP_FILE();
*/

//member functions

int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char *filename);
};
          
and i couldnt find a place to put this: *BITMAP_FILE_PTR which is found on the previous structure. [edited by - edwinnie on May 6, 2002 9:58:00 AM]
for: *BITMAP_FILE_PTR

do:

typedef BITMAP_FILE* BITMAP_FILE_PTR;


Your data members should be private, and the methods (Load_Bitmap_File) public. Also, your methods (L_B_F) don''t have to take a BITMAP_FILE_PTR, because it is now a class and refers to itself via the "this" pointer.. you no longer need to pass the object to load the data into.

Advertisement
thx!

This topic is closed to new replies.

Advertisement