Archived

This topic is now archived and is closed to further replies.

Please help with simple class problem

This topic is 6475 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is part of my modified lesson14 code. It compiles and runs, but doesn''t show the h.. Thanks! class myclass{ private: char mydata[6]; public: void printclass(){mydata[0]=''h''; glPrint(mydata);} }; int DrawGLScene(GLvoid) { glClear(GL_COLOR_BUFFER_BIT / GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef(0.0f,0.0f,-22.0f); glColor3f(0.5f,0.0f,0.5f); myclass m; m.printclass(); return TRUE; }

Share this post


Link to post
Share on other sites
Hmm, just an idea, try zero-terminating the string (with a ''\0'' character). It may not make a whit of difference, but it''s worth a try. So make item 1 (from a zero based index) in the array equal to ''\0''.

Morgan

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
classes fuckin suck so don''t use them, use qbasic

Share this post


Link to post
Share on other sites