Okay, i wanted to create a header file that had prototypes for a cpp file(file 1). The cpp file consists of a class(class 1) and its member functions. Both files have been debugged.
Now, i want to use that class in a new program(file 2). So, i made sure to include my header file. In file 2, i have a class(class 2)...
and i want to declare a private instance of class 1 within it. So, this is what i put in file 2...
...
const int num = 5;
class class2
{
private:
class1 name(num);
public:
...some declarations...
};
...
NOTE: The class1 constructor takes one integer argument
When i try to compile, i get these errors:
----------------
error C2146: syntax error : missing ';' before identifier 'name'
error C2501: 'class1' : missing storage-class or type specifiers
error C2059: syntax error : 'constant'
----------------
How can i get this to work? Any help would be appreciated.. thnx
-GhostAgent