However, I've run into an apparent problem.
Code: Select all
#include <iostream>
using namespace std;
int main()
{
int width, length, height;
cout << "What is the value that you'd like to enter for width? ";
cin >> width;
cout << "What is the value that you'd like to enter for length? ";
cin >> length;
cout << "What is the value that you'd like to enter for height? ";
cin >> height;
cout << "Okay! Now, the volume of your object is: " + width * length * height;
return 0;
}
The above [should] be a very simple concept. I went into notepad, wrote it, then saved it to my desktop as Document1.cpp
I have Microfuck Visual Fuckup C++ 2010 Express Edition, just because it's a fun thing to mess around with, particularly the GUI.
I, for the life of me, cannot get my computer to execute a .cpp file alone, apparently it wants something more. However, my current guide doesn't really specify that.
I did, though, figure out that Bloodshed Dev-C++ will allow me to execute my cpp file, and it does it functionally.
A minor complaint, though, is when Winblows runs the .cpp file, it doesn't wait after the final inputs are sent and it doesn't allow the user to see the final cout >> line, and I don't remember how to deal with that.
The program will do something like:
Code: Select all
What is the value you'd like to enter for height? (input)
What is the value you'd like to enter for length? (input)
What is the value you'd like to enter for width? (input)
<Now! Here, the program should output the final line containing the string + volume, but it doesn't, the program shuts down immediately after outputting the line, which isn't what I wish to achieve.>
If so, please do share the proper command, which I forgot.
Edit: In regards to MSVSC++, I try to make a Console application, put my code into the .cpp file, and debug it, but that's apparently asking a whole lot. The program seems to depend on many other useless things, making everything complicated. Gotta love Microsoft and their programs..
It even goes as far as to tell me that (even after including the iostream) cout << and cin >> don't exist.