Please help with simple class problem
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
Morgan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement