{
#include "stdafx.h"
#include <iostream.h>
#include <stdio.h>
#include <string.h>
class inventory
{
private:
int prodID;
char prodDescription[20];
int qtyInStock;
public:
inventory()//default constructor
{
prodID=0;
strcpy(prodDescription,"-");
qtyInStock=0;
}
inventory(int a,char *b,int c) //constructor that initializes a new Inventoryobjects with the values passed as arguments
{
prodID=a;
strcpy(prodDescription,b);
qtyInStock=c;
}
};
int main(int argc, char* argv[])
{
inventory obj(1,"cotton tshirt",4);
return 0;
}
Please Im not trying to get my homewotk done, just to understand my errors.
It complies without problem. But doesn't run.
Thanks again.
Arizal 0 Newbie Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.