i have this 4 function that i want my vector to work into..
function 1: where i started inputting in my vector
function 2: where i will be ask if i want to add another input or print it
function 3: where my answer in function 2 will be evaluated, if want to add.. we will go back to function 1 and add another item to our vector, and if print we will be proceed to..
function 4: where we need to print all inputs in function 1
here is my super confusing code:
function1()
{
do{
cout<<"\n\n ";
cout<<"Product Number ('0'-List of Products): ";
cin>>n;
prodnum.push_back (n);
if (cin.fail())
cout<<"\n\nError! Input an integer.\n";
else
supernestedif (n, quan=0);
}while (n==0 || n>10);
do{
cout<<" Quantity: ";
cin>>quan;
quantt.push_back (quan);
if (quan==0)
cout<<"\n\n Order atleast 1.\n\n";
else if (quan>10000)
cout<<"\n\n We cannot take too many orders.\n\n";
}while (quan==0 || quan>10000);
function 2();
return 0;
}
function2()
{
cout<<"\n\n Do you want to..\n";
cout<<" T-Compute Total A-Add Product\n";
function3 (wntto);
return 0;
}
function3(char w)
{
char surexit;
if (w=='T' || w=='t')
function4 ();
else if (w=='A' || w=='a')
function1();
return w;
}
void functionA(vector<int> MyVector)
{
int a = MyVector.at(MyVector.begin());
}
void functionB(vector<int> &MyVector)
{
int a = 0;
MyVector.push_back(a);
}
Oh by the way, your functions don't have types. You need to make them int or void or something.