Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (christos):

C++ Task: http://screencast.com/t/4EDESKcj Code for the Task:http://pastebin.com/jrFCimga Error I am getting: http://screencast.com/t/ndEPszkq Why am I getting this Error?? I don't understand??

OpenStudy (snuggielad):

@dumbsearch2 Get over here now...i know you can do this...

OpenStudy (christos):

Help me someone please, I know there is a detail I am missing and its driving me crazy...

OpenStudy (snuggielad):

@dumbsearch2 Is like a wizard...he is just slow as heck

OpenStudy (christos):

What do you mean @dumbsearch2 ? Like what looping macro ???

OpenStudy (dumbsearch2):

Your using the variables without giving them their "default" value. This warning will go away if you do this: int k = 0; for each variable. k being the variable name.

OpenStudy (dumbsearch2):

Tell me if that works, or helps.

OpenStudy (dumbsearch2):

Though please note that I have only started picking up C++ in the past week, PHP, Java and the web languages are what I'm best at.

OpenStudy (christos):

Bro now its letting me run the program but It doesn't work, for example what ever variable I enter to the program, it doesn't display anything

OpenStudy (christos):

@dumbsearch2

OpenStudy (dumbsearch2):

What errors do you see left ? or warnings

OpenStudy (christos):

There are no further syntax errors left, the program just doesn't work correctly. @dumbsearch2

OpenStudy (dumbsearch2):

@opcode He's an expert at C++! But huh! This is so weird...

OpenStudy (christos):

Please help me guys :(

OpenStudy (dumbsearch2):

http://www.stackoverflow.com/

OpenStudy (christos):

Dude what is this?

OpenStudy (dumbsearch2):

It's so easy to sign up. It's the biggest programming forum. You get the answers in 1-5 minutes. StackOverflow

OpenStudy (rsmith6559):

You have a few problems with that code. I'm surprised that you got a compile out of it. Blocks of code, a block being more than one line, need to be started and ended with curly brackets ( "{}" ). It will also help the readability of your code, and it needs it. Your if() statements are logically wrong. They're comparing a variable a against an uninitialized variable. You probably want to compare to a literal value: if (a == 'd' || a == 'D' ) { // do something } There may be a problem in your if() statements that comes down to operator precedence. In complex condtionals like above, I was taught to write them: if( (a == 'd' ) || ( a == 'D' ) ) { } which would || the results of the two ==. Without the parentheses, I'm not sure that || would evaluate after ==.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!