Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic simple question

Status
Not open for further replies.

lamayo

Programmer
Joined
Aug 29, 2003
Messages
4
Location
US
I'm new at C++ and I cant get my compiler to do what I want it to do. I found a tutorial that says enter the following

#include <iostream.f>
int main
{
cout <<&quot;sum text&quot;;
return 0
}

When I do the following errors come up:

22 C:\Dev-Cpp\Templates\main.c:1
iostream.f: No such file or directory.

3 C:\Dev-Cpp\Templates\main.c
syntax error before '{' token

What am I doin wrong. Also sometimes I get a 1010 error I think, any ideas?
 
oops I mean its <iostream.h>
 
That first error is because you put .f instead of .h.

To fix the second one, look at your tutorial and see what it has after the word &quot;main&quot; that you're missing.

A third problem is the lack of a semicolon after &quot;return 0.&quot;


Finally, your tutorial is giving you old advice; use <iostream> instead of <iostream.h>. Everything should work the same (although you'll also need to put &quot;using namespace std;&quot; at the beginning of your programs).
 
#include <iostream.h>
int main()
{
cout <<&quot;sum text&quot;;
return 0
}
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top