BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with constructors/destructors

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder
View previous topic :: View next topic  
Author Message
daveandmarie@gmail.com
Guest





PostPosted: Fri May 26, 2006 4:25 am    Post subject: Problem with constructors/destructors Reply with quote



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();
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.