|
-
May 1st, 2010, 12:36 AM
#1
linker error caused by class - help needed
i'm working on a small project and i created a class called item that takes two arguments one double and one int,
i've i have a default blank build for that class with no arguments as well where the user can set them if needed.
i'm trying to make an array of them and i'm getting a linker error for unresolved externals
here is a segment of my code.
[code]
class Item
{
public:
// Constructors
Item();
Item(double price, int gramsOfFat);
private:
double price;
int gramsOfFat;
}
void main ()
{
const int MAX_ITEMS = 10;
Item vendingMachine[MAX_ITEMS];
// other stuff
double Price = 0;
int GramsOfFat = 0;
}
I have other code but i think this is the problem, any help would be great.
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
|
Click Here to Expand Forum to Full Width
|