c++ - Simple class constructor initialization errors -
Using the name of the placeholder in the following code pieces can someone please explain that I have C 2065 (Apple undeclared identifier) and C 2228 .weight / .color / .price left) should be square / straight / union? Definitely if the variable matches the declaration, then it should proceed with the loop without any problem.
int variable = (algorithm that creates a number); If (variable == fixed number) {Falbug 1 apple (40,50); } Else if (variable == another fixed number) {fruitbag2 apple (25,50); } Else if (variable == another fixed number) {fruitbag3 apple (30,50); } While (position) {while (another condition) {apple.weight (); Apple.colour (); } Apple.price (); }
I tried to minimize this problem so that there is no benefit in the same errors:
int variable = (algorithm that creates a number ); If (variable == fixed number) {Falbug 1 apple (40,50); } Else if (variable == another fixed number) {fruitbag2 apple (25,50); } Else if (variable == another fixed number) {fruitbag3 apple (30,50); } If (variable is within the limit of certain numbers) {while (condition) {while (another condition) {apple.weight (); Apple.colour (); } Apple.price (); }}
found solutions:
long and inefficient, but works well
Int variable = (algorithm that creates a number); If (variable == fixed number) {Falbug 1 apple (40,50); While (status) {while (another condition) {apple.weight (); Apple.colour (); } Apple.price (); }} If (variable == another fixed number) {fruitbag2 apple (25,50); While (status) {while (another condition) {apple.weight (); Apple.colour (); } Apple.price (); }} If (variable == another fixed number) {fruitbag3 apple (30,50); While (status) {while (another condition) {apple.weight (); Apple.colour (); } Apple.price (); }}
apple
- the square is not met.
Make sure you have #include "apple.h"
or similar to your main file. Otherwise the apple
category is not found. If it is defined in the same file, make sure that the function using apple
is defined correctly above .
Comments
Post a Comment