-
October 23rd, 2013, 04:41 PM
#10
Re: If else statement displaying both options.
Originally Posted by Arjay
Initialize your variables means to declare them and then set them. You can do this all in one step. In C++, initializing variables prevents a variable from starting out with garbage and it's a good practice to get into (because they are often a source of bugs).
Code:
int x; // uninitialized variable it's anyone's guess what its starting value will be.
int y = 0; variable declared and initialized to 0
So if I want the variable to be something the user enters, how do I initialize it?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|