sorry it has some glut and openGL stuff too :O)
Code:
#include <windows.h>
#include <gl\glut.h>
#include <gl\gl.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
#include <math.h>
#include <time.h>
#include <float.h>
#include <assert.h>
#include <iostream>
#include <string>
using std::cin;
using namespace std; //// needs #include <iostream>
class GradeBook
{
public:
void displayMessage(string courseName)
{
printf("Welcome to the grade book\n", courseName);
}
};
void RenderScene(void)
{
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
void SetupRC(void)
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
GradeBook myGradeBook;
char *nameOfCourse = ""; // = "hello class";
printf("Please enter the name:\n");
cin.getline(nameOfCourse, 50);
myGradeBook.displayMessage( nameOfCourse );
Sleep(20); //needs #include <windows.h>
glutCreateWindow("Simple");
glutDisplayFunc(RenderScene);
SetupRC();
glutMainLoop();
}