Well an if/else statement looks like this:
if( expression )
{
// do this
} else {
// do this
}
Type: Posts; User: QuietWhistler
Well an if/else statement looks like this:
if( expression )
{
// do this
} else {
// do this
}
Do you get any warnings? If you leave clearBuffer() out, does it work then ?
What are you using for displaying the string ? cout, printf() or what?
What do you mean ? Is ProductDesc empty after you called getline() ?
Try pressing enter again after your input.
--Shady
You have to clear the buffer after you use getline() like this:
void clearBuffer
{
string temp;
getline(cin, temp);
}
This might be an incomplete answer, but I'll try anyway.
You can place them under here:
- Shape
- Rectangle
Things I'd take a look at:
- The protected member functions of the superclass....
#pragma comment(lib, "Winmm.lib")
that should work
You use functions of the type 'void' if you don't need an output value. For example if you have a function that only prints some text to the screen, you would use type 'void', because you don't need...
That's correct, because (0 + 0 + 0)/3 = 0.
My bad.
You have to assign french, german and spanish a number first, because else it will go wrong.
do it like this:
int french = 0, german = 0, spanish = 0;
This way the 0's will be overwritten by...
OK, thanks!
I would like to know what a programmers average salary is? Not precise, but is it a good paid job ? Thanks
Yes, you now assign tal the number 0. You don't check if the number is equal to zero. So it will break out of the if statement.
Change if(tal = 0) to if(tal == 0)
You know, a long double's range is: 3.4^-4932 to 3.4^4932. So I don't think it will be a problem. I'd use long though.
What compiler are you using ? When I compile it in Visual C++ 2005 Express, it works just fine.
But it's only the - Operator, and I tested it in Dev-Cpp and there it compiles with no errors.
Hey,
I have this class:
class Integer
{
private:
int integer;
OK thanks!
I'm using Microsoft Visual C++ Enterprise edition, yes
Hey, I have a simple question.
My test main:
int main()
{
Player player;
string name;
If you want to pass the structure to a function, pass it by reference, this saves memory and you don't have to return the structure.
struct database {
int id;
int age;
float...