Dragon Keeper
06-08-2004, 01:46 PM
Whats wrong with this code, it tells me there are 5 errors but I got it straight out of a book...btw I'm using visual C++ 6.0
// Listing 2.2 using std::cout
#include <iostream>
int main()
{
std::cout << "Hello there.\n";
std::cout << "Here is 5: " << 5 << "\n";
std::cout << "The manipulator std::endl ";
std::cout << "Writes a new line to the screen.";
std::cout << std::endl;
std::cout << "Here is a verry big number:\t" << 70000;
std::cout << std::endl;
std::cout << "Here is the sum of 8 and 5:\t";
std::cout << 8+5 << std::endl;
std::cout << "Here's a fraction:\t\t";
std::cout << (float) 5\8 << std::endl;
std::cout << "And a verry big number:\t";
std::cout << (double) 7000 * 7000 << std::endl;
std::cout << "Don't forget to replace jesse liberty";
std::cout << "With your name...\n"
std::cout << "Joth Colgrove is a c++ programmer!\n";
return 0;
}
// Listing 2.2 using std::cout
#include <iostream>
int main()
{
std::cout << "Hello there.\n";
std::cout << "Here is 5: " << 5 << "\n";
std::cout << "The manipulator std::endl ";
std::cout << "Writes a new line to the screen.";
std::cout << std::endl;
std::cout << "Here is a verry big number:\t" << 70000;
std::cout << std::endl;
std::cout << "Here is the sum of 8 and 5:\t";
std::cout << 8+5 << std::endl;
std::cout << "Here's a fraction:\t\t";
std::cout << (float) 5\8 << std::endl;
std::cout << "And a verry big number:\t";
std::cout << (double) 7000 * 7000 << std::endl;
std::cout << "Don't forget to replace jesse liberty";
std::cout << "With your name...\n"
std::cout << "Joth Colgrove is a c++ programmer!\n";
return 0;
}