prog.cpp:19:1: error: unknown type name 'D1'
D1.name = "AmericanCheese";
^
prog.cpp:19:3: error: cannot use dot operator on a type
D1.name = "AmericanCheese";
^
prog.cpp:20:1: error: unknown type name 'D1'
D1.weight = 0.4;
^
prog.cpp:20:3: error: cannot use dot operator on a type
D1.weight = 0.4;
^
prog.cpp:21:1: error: unknown type name 'D1'
D1.calories = 375;
^
prog.cpp:21:3: error: cannot use dot operator on a type
D1.calories = 375;
^
prog.cpp:22:1: error: unknown type name 'D1'
D1.protein = 5;
^
prog.cpp:22:3: error: cannot use dot operator on a type
D1.protein = 5;
^
prog.cpp:23:1: error: unknown type name 'D1'
D1.fat = 8;
^
prog.cpp:23:3: error: cannot use dot operator on a type
D1.fat = 8;
^
prog.cpp:24:1: error: unknown type name 'D1'
D1.carbohydrates = 0;
^
prog.cpp:24:3: error: cannot use dot operator on a type
D1.carbohydrates = 0;
^
prog.cpp:25:1: error: expected unqualified-id
return 0;
^
prog.cpp:28:23: error: declaration of anonymous struct must be a definition
int dairy(int weight, struct* cheese)
^
prog.cpp:28:23: error: expected parameter declarator
prog.cpp:35:14: warning: implicit conversion from 'double' to 'int' changes value from 0.4 to 0 [-Wliteral-conversion]
int weight = 0.4;
~~~~~~ ^~~
prog.cpp:39:20: error: 'cheese' does not refer to a value
cout<<dairy(weight,cheese)<<endl;
^
prog.cpp:8:8: note: declared here
struct cheese
^
1 warning and 16 errors generated.