I have some problems with creating functions. I think I did everything right, but I can't figure out the problem. i will post the code. I know some of it might be incorrect now, but I will fix that...
Type: Posts; User: DarkSFK
I have some problems with creating functions. I think I did everything right, but I can't figure out the problem. i will post the code. I know some of it might be incorrect now, but I will fix that...
Never mind, I fixd the problem. And, I did it without help!
I mean, I don't know why it's messed up. How do I fix it? Should I post my source code?
I made a new program, and successfuly got it to work without any help! Well, sorta. I have a GNU C++ compiler, and when I click Run>Run, the program executes EVERYTHING without any errors. But, when...
I don't know how to do random numbers yet.:(
EDIT: Hmmm............ does anyone know how to set the variable as a random number between 1 and 1000 everytime you open the file?
I have made improvements to my number game. I have made it so you have to enter a number that you will guess. Like this:
You enter 651. That would be the number you have to guess.
But, when you...
Yeah, you helped. In C++ for dummies, it doesn't say you need braces before and after the 'else'. It doesn't even show that in example programs.:confused:
>Switch is only used in case statments.
I am extremely dumb......-_-
Thanks for the help. I forgot about the braces around the else statements.
Well, I started with switches, and completely understand them and how they work. But, I have 2 errors when trying to compile my improved number game. Here is the code:
#include <stdio.h>...
Well, I got it working, and I'm starting on switches in the book tomorrow, since it's too late for me to think right now. Anyway, I hope to make some improvements on it. Thanks again for your help.
So:
#include <iostream.h>
#include <conio.h>
int main()
{
//code
}
One more problem. I got the program to loop fine and everything, but when it displays the message: That's correct, it just exits. Is there any way to make the program terminate by pushing a key?
I feel so stupid. I have no idea why I didn't think of that.
Ok, so let me get this straight, the program uses the loopCount variable to loop everything after while(loopCount>0) statement?
Oh, yeah, I tried doing the while command after the code I just...