Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

acess violation error

Status
Not open for further replies.

oconv

Programmer
Jan 17, 2002
25
ZA
Hi All,

I'm not a regular C++'er , so maybe this will be easy.

I have 3 classes Driver , Savings & Customer.
Savings public inherits Customer.
The varibles in Customer is CustNumber (char*)
CustName, (char*)
CustTelNo. (long)

The Savings class has a constructor that accepts a char* it looks like this :

Savings(char* TempCustNum):Customer(TempCustNum){};

and then the Customer Constructor looks like this:

Customer(char* TempCustNum){
CustNumber = TempCustNum;
cout << &quot;Enter the Customer number&quot;;
cin >> CustName;
}

so this is what happens

In the driver I ask for a customer number , get it & then
constuct a instance of the savings class with the number that i just got from the user , the Savings class's constructor then calls the Customer class constructor , withc then set the CustNumber varible , & then asks for a Name , this is where the error steps in the moment I press Enter after I typed in the Customer Name

It goes back to the Borland compiler with a message box and says something about a execption error occured & give some memmory adress.

PLEASE HELP ME OUT OF MY MISSERY , I have no idea what to do.


Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top