Well they say that there is no such thing as a stupid question...well here I am
Alright I am learning and reading a book and they were talking abut constants so I decided that it would be interesting to go and check them out and try them for myself, so this is what I came up with:
Now I have made a few small programs to play with things and have managed to fix all of those errors, with some help from the board of course, but this time I am truly lost, here are the errors:Code:#include <stdio.h> unsigned int positive; int posAndneg; const double decimal1 = 1.123321; #define decimal2 = 2.234432; double userTotal = positive + posAndneg; double userTotalF = userTotal + decimal1 + decimal2; /*First time error occoured*/ main(void) { printf("Please enter a positive number: "); scanf("positive"); printf("Please enter another number(either positive or negative)"); scanf("posAndneg"); printf("The total of adding both of your numbers together is: %f", userTotal); printf("The computer will now add %d and %d to the total of your two numbers", decimal1, decimal2); /*Second time error*/ printf("The final total is: %d", userTotalF); return 0; }
error C2059: syntax error : '='
Now I get this one but it appears twice, it appears the first time on the line that has the comment "first time" on it and this I think is just me not knowing about the different types of variables and such so that should be easy for someone who knows.
Then it appears again on the line that has "second time" on it and I don't get that one at all because I can't seem to find the '=' in it.
And finally
syntax error : missing ';' before ')'
I know what this means and how to fix it but I have no idea where to put the ; , the error appears on the same line as 'Second time'
If someone can help give a bit of a lesson I would be grateful.