| Qmechanics (8) | |
|
So basically im 14 and just startd c++, i bought a book and am self learning, im doing quite well but i am having trouble with my newest code. Please fix it, and tell me what i can do next time to fix it myself. Thank you. Code: #include <iostream> using namespace std ; int main () { const double PI = 3.145926536 ; cout << "6\" circle circumference: " << (PI * 6) << endl ; enum ; { RED=1, YELLOW, GREEN, BROWN, BLUE, PINK, BLACK } ; cout << "I shot a red worth:" << endl ; cout << "Then shot a blue worth:" << endl ; cout << "Total scored: " << ( RED + BLUE ) << endl ; typedef enum { NEGATIVE , POSITIVE } charge ; charge neutral = NEGATIVE , live = POSITIVE ; cout << "Neutral wire:" << neutral << endl ; cout << "Live wire:" << live << endl ; Return 0 ; } | |
|
Last edited on
|
|
| maeriden (244) | |
|
1- use code tags 2- if you want help provide us with information about the problem | |
|
|
|
| KungFu97 (20) | |||
It would also help if you explained what the outcome is meant to be. Is this meant to be a program about archery or something because I have absolutely no idea. It would also be helpful to wrap your code in the code tags, like:
and also explain what the problem actually is. | |||
|
Last edited on
|
|||
| Qmechanics (8) | |
|
oh yea, sorry i forgot, it is supposed ot be a constant. The problem when i compile and run it, is that it says "Expectd unqualified-id before "{"" And as for the tags, i dont know how to do it, ill look into it and try and get it fixed. my bad. | |
|
Last edited on
|
|
| maeriden (244) | |
| There is a semicolon after the first enum | |
|
|
|
| Qmechanics (8) | |
| Ohkay fixed that, but now it says that "Return was not declared in this scope" as well as "expected ; before numeric constant". | |
|
|
|
| maeriden (244) | |
| Write "return" with lowercase r | |
|
Last edited on
|
|
| Qmechanics (8) | |
| Thank you, :D i cant belive a lower case "R" was what was ruining the entire programd :D anyway thanks for the help :) its appreciated. | |
|
|
|