daveandmarie@gmail.com Guest
|
Posted: Fri May 26, 2006 4:25 am Post subject: Problem with constructors/destructors |
|
|
I am having problems figuring out why my constructors and destructors
are not working for this simple (!) program. When run, the program
simply waits at getch() for input then exits. Using the student trial
edition of C++ builder.
#include <stdio.h>
#include <iostream.h>
#include <string.h>
#include <conio.h>
class Course
{
private:
char name[20];
int credits;
public:
Course( ) { cout << "\nEnter the course's name and number of
credits: ";
cin >> name >> credits;}
~Course( ) { cout << name << " " << credits;}
};
void main(void)
{
Course test();
getch();
} |
|