Articles

Solved how to save user input into an array then display it

December 26, 2012 at 02:21:40
Specs: Windows 8

hi..im doing a program of choosing food menu in each day. how im suppose to save user choice of day into an array and then display it in another function

See More: how to save user input into an array then display it

Report •


#1
December 26, 2012 at 11:59:56


Report •

#2
December 26, 2012 at 15:22:40

int totalprice1;
int totalcalorie1;
//system("cls");//system clear to new display
if (bmi<=18.5)
{
cout<<"underweight"<<endl;
cout<<"Suggested Meals:KOREAN RICE BOWL - 430kcal"<<endl;
cout<<" :VEGETARIAN MEXICAN PIZZA - 294kcal"<<endl;
cout<<" :CHOCOLATE SMOOTHIE - 30kcal"<<endl;
cout<<"Total Price :RM 10.50"<<endl;
totalprice1=10.50;
int total=430+294+30;
totalcalorie1=total;
cout<<"Total Calorie :"<<total<<"kcal"<<endl;
cout<<"SAVE MENU?:1.YES 2.NO"<<endl;

cin>>SAVEDATA[1];


this is a part of the program.im trying to save the data inside an array SAVEDATA.my program run without problem but i dont know wheather it really save it into an array or not. this part is inside a function menu(). how can i display the SAVEDATA in another function.for example detail()
where did i do wrong..?


Report •

#3
December 29, 2012 at 09:34:32
✔ Best Answer

seems like you could just do an output of the array...perhaps with

printf("%d\n", SAVEDATA[1];

:: mike


Report •

Related Solutions


Ask Question