0

Guys help me how to resolve this my cin>>*goods. candies and so on please help me

#include<iostream> using namespace std; struct store { int sum, candies, chips, icecream, bread, fruits; }; int main() { store *goods, product; goods = &product; cout<<"==========Mang Tani Sari Sari Store Inventory==========\n"; cout<<"Total Stock Of Candies :\t"; cin>>*goods.candies; cout<<"Total Stock Of Chips :\t"; cin>>*goods.chips; cout<<"Total Stock Of Ice cream :\t"; cin>>*goods.icecream; cout<<"Total Stock Of Bread :\t"; cin>>*goods.bread; cout<<"Total Stock Of Fruits :\t"; cin>>*goods.fruits; goods -> sum = (goods->candies+goods->chips+goods->icecream+goods->bread+goods->fruits); cout<<"==============================\n"; cout<<"The Total Number Of Goods Mang Tani Has Is :" <<*goods.sum<<endl; return 0; }

22nd Oct 2021, 11:43 AM
SAAR MAFFY G.
2 Antworten
0
Replace all *goods.<member-name> by goods-><member-name> Please, indent the code properly to improve readability. Also next time, prefer to save the code in SoloLearn, and share the code link instead. With code bits, we can simply refer line number for correction https://www.sololearn.com/post/75089/?ref=app
22nd Oct 2021, 12:46 PM
Ipang
0
i try that but there's an error.
22nd Oct 2021, 5:06 PM
SAAR MAFFY G.