|
-
October 9th, 2002, 10:37 PM
#1
Member
c++ newb help
Cant get this to work anyone see something i dont . it compiles w/no errors borland but will not run .
#include <iostream.h>
#include <string.h>
class automobile{
private:
char *make, *model, *color, *engine;
public:
void set_values (char *, char *, char *, char *);
void display() {cout << make<< model<< color<< engine;}
};
void automobile::set_values (char* a,char* b,char* c,char* d)
{
strcpy(make, a);
strcpy(model, b);
strcpy(color, c);
strcpy(engine, d);
}
void main(){
automobile car;
car.set_values ("honda", "accord", "blue", "v6");
car.display();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|