Jump to content
Fórum Script Brasil
  • 0

Programa Alô Mundo


LionX

Question

Oi galera, sou novo no forúm e estou encontrando um problema em um programa básico

//AloMundo.cpp
//Um programa elementar.
#include <iostream.h>
int main()
{
cout << "Alo, Mundo!\n" ;
return 0;
}[/codebox]

Até ai tudo bem, mas, ele da o seguinte erro:

[codebox]3 C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31, from C:\C\Alomundo.cpp In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from C:\C\Alomundo.cpp

3 C:\C\Alomundo.cpp from C:\C\Alomundo.cpp
32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.

Eu procurei e achei que '<iostream.h>' é um comando antigo e poderia usar '<iostream>'. Mas, da outro erro:

 C:\C\Alomundo.cpp In function `int main()': 
6 C:\C\Alomundo.cpp `cout' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.) [/codebox]

Eu até achei outras formas de fazer, mas o interessante era fazer 'dessa forma' só que eu queria saber como concertar o erro... Se poderem me ajudar eu agradeço

Edited by LionX
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Ola, do jeito que está o código só no Borlan compila. no Dev você tem que

fazer as seguites mudanças:

#include <iostream>

#include <conio.h>

using namespace std;

int main()

{

cout << "Alo, Mundo!\n" ;

getche(); // Esta função é da conio.h, pausa a mensagem e aguarda você pressionar alguma tecla para fechar

}

Faou,? Abraços...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...