iostream.h

G

Guest

hi,

i have copied some c++ code from a book. here it is:

#include <iostream.h>
int Add (int x, int y)
{
cout << "In Add(), received " << x << " and " << y << "\n";
return (x+y);
}

int main()
{
cout << "I'm in main()!\n";
int a, b, c;
cout << "Enter 2 numbers: ";
cin >> a;
cin >> b
cout << "\nCalling Add()\n";
c=Add(a,b);
cout << "\nBack in main().\n";
cout << "c was set to " << c;
cout << "\nExciting\n\n";
return 0;
}

i keep getting an error, though: "fatal error C1083: Cannot open include
file "iostream.h". no such file ot directory exists"

what do i do to get rid of this error? do i set the using precompiled
headers property to use precomplied headers?
 
N

Nemanja Trifunovic

Throw away the book, and find a newer one.

#include <iostream>
using namespace std;
 
J

Jason Felix

you should use "#include<iostream>" instead of "#include<iostream.h>", if
you use VS.NET. besides this, your project is very simple which means you
didn't use STL, MFC or .NET, so you can build up a empty project (under
..NET ) and add a .cpp file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top