can't get sample code to compile

Here is some sample code out of a book that won't compile.. The error says that it can't find the "xxx.exe" file that I'm trying to compile/run.

[code]


#include <iostream>
using namespace std;
int stonetolb(int);
int main()
{
int stone;
cout << "Enter the weight in stone: ";
cin >> stone;
pounds = stonetolb(stone);
cout << stone << " stone are ";
cout << pounds << " pounds.\n";
return 0;
}

int stonetolb(int sts)
{
return 14 * sts;
}


[/code]



The output is suppose to be:

Enter the weight in stone: 14
14 stone are 196 pounds.
Sorry.. The following is the right code out of the book..

#include <iostream>
using namespace std;
int stonetolb(int);

int main()
{
int stone;
cout << "Enter the weight in stone: ";
cin >> stone;
int pounds = stonetolb(stone);
cout << stone << " stone are ";
cout << pounds << " pounds.\n";
return 0;
}

int stonetolb(int sts)
{
return 14 * sts;
}
I'm sorry.. I don't know what the problem was before, but it's working now... ; (
Looks fine to me lol
EEVIAC, there's no point to bumping your thread every 3 minutes, someone will eventually respond, it may take 15mins it may take 6 hours.
Or it might never happen. But when I see a bump I feel strongly unwilling to respond.
and @OP: You are using code tags wrong. Most tags don't nest; by bolding the tag you prevent it from wrapping your code. You can bold stuff in code tags but you can't bold the tags themselves.
Last edited on
Topic archived. No new replies allowed.