Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: iostream.h no such file or directory [duplicate]

Tags:

c++

codeblocks

Possible Duplicate:
No such file iostream.h when including

Even after naming the source file with .cpp extension. my compiler gives this error, both in command prompt and Codeblocks. How can I fix this issue?

#include <iostream.h>   int main(){      cout<<"Hello World!\n";     return 0; } 
like image 761
Assasins Avatar asked Oct 24 '12 13:10

Assasins


People also ask

How do I fix iostream H No such file or directory?

add this line before main using namespace std; or qualify every functuon call to cout with std:: like std::cout remove getch() it is non-standard function Seems like you are stuck with TurboC++ Add the tag as C++ instead of "help". Keep it simple, remove ".

What is fatal error in C++?

In computing, a fatal exception error or fatal error is an error that causes a program to abort and may therefore return the user to the operating system. When this happens, data that the program was processing may be lost.

Why is iostream used in C++?

Input/output streams Like the cstdio header inherited from C's stdio. h, iostream provides basic input and output services for C++ programs. iostream uses the objects cin , cout , cerr , and clog for sending data to and from the standard streams input, output, error (unbuffered), and log (buffered) respectively.

Does Dev C++ support iostream?

Dev C++ couldn't support with iostream.


2 Answers

That header doesn't exist in standard C++. It was part of some pre-1990s compilers, but it is certainly not part of C++.

Use #include <iostream> instead. And all the library classes are in the std:: namespace, for ex­am­ple std::cout.

Also, throw away any book or notes that mention the thing you said.

like image 88
Kerrek SB Avatar answered Sep 18 '22 09:09

Kerrek SB


Using standard C++ calling (note that you should use namespace std for cout or add using namespace std;)

#include <iostream>  int main() {     std::cout<<"Hello World!\n";     return 0; } 
like image 33
il_guru Avatar answered Sep 18 '22 09:09

il_guru