using class sets


I'm trying to figure out how to print my class i have here, but i keep getting errors (2 of them). I'm pretty sure i defined everything accordingly, and i am having a problem ending the program. That is what th errors are stating . could someone please guide me in the right direction? Here are my errors and my code that i have:


class cars.cpp(37) : error C2061: syntax error : identifier 'VinNumber'
class cars.cpp(44) : fatal error C1004: unexpected end of file found



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
using namespace std;


	
	
	class car {
     public : 

	car(int ,char ,char ,int ,int);
	void setVinNumber(int);
	void setMake(char[10]);
	void setModel(char[10]);
	void setYear(int);
	void setFuelCapacity(int);

	

    private : 
    
       char vin[10];
       char make[10];
       char model[10];
       int Year;
       int FuelCapacity;


void printCarDetails(VinNumber, Make, Model, Year, FuelCapacity) const;





	}
Is that your entire class or a 'mis-post' by you? The only thing incorrect about it is you have missed the semi-colon at the end of class (after the last curly brace).

Also, i'm not sure if the member functions 'setMake' and 'setModel' can specify that an array of 10 chars is to be passed. Not sure if it will get removed by the compiler, cause undefined behaviour, or be acceptable; you'll have to get that verified by someone more compotent than myself.
Line 28: void printCarDetails(VinNumber, Make, Model, Year, FuelCapacity) const; You didn't specified the type of the parameters
Bazzy: what do you mean by specifying parameters? are you talking about the set for printing it?
The types eg: int, char ...
Topic archived. No new replies allowed.