.·)Tusky(·. 0 Newbie Poster

I'm using the Window Console to create a excerice out of a book for beginers. First it's coded to ask for a number, then after you press the enter key it tells you the results, in about 2 seconds it just closes the Window Console. How can I prevent the Window Console from closeing? I'll give you the code below.

#include <iostream>
using namespace std;

double Cube (double Value);

main () 
{
    double Number, CubeNumber;

    cout << "Enter a number: ";
    cin >> Number;

    CubeNumber = Cube (Number);

    cout << CubeNumber << endl;

    return 0;
}

double Cube (double Value)
{
    double CubeReturn;

    CubeReturn = Value * Value * Value;

    return CubeReturn;
}
.·)Tusky(·. 0 Newbie Poster

Well, I put in a number and then it worked not as i planed although. First i enterd the first, then the second, then the third. Then it just shuts the window concole.

.·)Tusky(·. 0 Newbie Poster

I'm new to C++ and I'm studying out of a book (Game Programming - All In One, 2002) From what I've seen from other programs it's sort of out of date. Can someone tel me what's wrong with this?

-Error C2734: 'Value' : const object must be initialized if not extern

(It origionaly used std::cout and std::cin)

#include <iostream>
using namespace std;


main (void)
{
const float Value, FeetPerMeter = Value;
float Length1;
float Length2;
float Length3;


cout << "Enter the first lenght in meters: ";
cin >> Length1;
cout << "Enter the second length in meters: ";
cin >> Length2;
cout << "Enter the third lenght in meters: ";
cin >> Length3;


cout << "First length in feet is: " << Length1 * FeetPerMeter << endl;
cout << "Second length in feet is: " << Length2 * FeetPerMeter << endl;
cout << "Third length in feet is: " << Length3 * FeetPerMeter  << endl;


return 0;
}

This is what the book told me to insert, but it even looks incorrect to me. HMM, does anyone know what's wrong with this?

.·)Tusky(·. 0 Newbie Poster

HAHA, it appears that no one knows how to do this, telling by the amout of replys. LOL . OH WELL

.·)Tusky(·. 0 Newbie Poster

What you just said....just ....(?) I HAVE NO IDEA WHAT YOU'RE TALKING ABOUT!!!

But, check this out
VVVVV VVVVV VVVV VVVVVVVVVVV VV V VVV VVVVVVVVV VV

.·)Tusky(·. 0 Newbie Poster

lol, DUH!

Blah Blah Blah

.·)Tusky(·. 0 Newbie Poster

So, like what's going on? I just started to learn C++ a few weeks ago. Umm! What's the deal. I don't wana learn it then just have to throught all of thoses hard days of work down the toilet. AHHH! I have absolutly no idea what the heck is going on!

.·)Tusky(·. 0 Newbie Poster

Hello Random People,

I'm new to C++, and I have some questions for all you'all. The first subject I'd like to talk about is Unary Operators. They give me a sample problem in the book. (The book is was published about 2 years ago)

Sample Problem:

int Result, A, B;

A = 4;
B = 23;
Result = 9 + (A++ - --B) * B

Result = ?

The answser -471.

I don't understand how you get that number. Can someone please explane to me how it works. :p