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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
#include "stdafx.h"
#include "product.h"
int product::pricemid = 0;
int product::number_of_products = 0;
int _tmain(int argc, _TCHAR* argv[])
{
int prod = 0;
int a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
product *p = new product [4];
p[0].set_it (20,"zwanzigeuroschein",100,"Geld");
p[1].set_it (40,"zweizwanzigeuroschein",100,"Geld");
p[2].set_it (60,"dreizwanzigeuroschein",100,"Geld");
for (int i=0; i != 1; )
{
char *name1 = new char[40] ;
char *name2 = new char [40];
char *name3 = new char [40];
cout << "was willst du tun?" << endl;
cin >> name1;
cout << endl;
if (name1 = "p")
{
cin >> a;
cin >> name2;
cin>> b;
cin >> name3;
p[prod].set_it (a,name2,b,name3);
cout << "1 für ende 0 für weiter";
cin >> i;
p[prod].printprice();
prod++;
if (prod >1)
{p[(prod - 1)].printprice();}
name1 = NULL;
delete [] name1;
delete [] name2;
//name2 = NULL;
delete [] name3;
//name3 = NULL;
}
else
{
cout << "no" << endl;
return 7;
}
}
//p[prod].printprice();
//p[--prod].printprice();
//p[1].set_it (100,"gold", 40, "Ressource");
//p[1].printprice();
//GEHT NICHT
//p1.~product () ;
//p1.printprice();
//product p1 (99, "gold");
cin >> a;
return 0;
}
|