Advertisement

Please help with simple class problem

Started by April 24, 2000 04:36 PM
3 comments, last by Mike00 24 years, 6 months ago
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; }
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
Advertisement
classes fuckin suck so don''t use them, use qbasic
qbasic? And classes don''t suck, they''re incredibly useful
Classes only suck if you don''t know how to use them.

This topic is closed to new replies.

Advertisement