dev-c++



  • hallo,
    bin blutiger anfänger und habe mir gerade den dev-c++ runtergeladen. natürlich hab ich sofort mit meinem c++ kurs angefangen. das "hallo welt" programm stand ganz am anfang. da gab´s dann leider schon das erste problem...

    #include <iostream.h>

    int main()

    {
    cout << "Hallo Welt!" << endl;
    }

    als ich dann auf compilieren und ausführen geklickt habe kam folgende fehlermeldung:

    #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.

    kann mir jemand verraten wieso ?

    Danke!!!



  • Guckst du hier



  • hoschi79 schrieb:

    als ich dann auf compilieren und ausführen geklickt habe kam folgende fehlermeldung:

    #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.

    kann mir jemand verraten wieso ?

    #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.[quote]

    Dein Quelltext sollte so aussehen:

    //Hier
    #include <iostream>
    
    using namespace std;
    
    int main() 
    {
      cout << "Hallo Welt!" << endl;
      return 0; //ist optional, am Ende von main wird automatisch 0 zurückgegeben
    }
    

    Als alternative zu using namespace std; kannst du auch immer das std:: voranstellen, z.B so: std::cout<<"Hallo Welt"<<std::endl;



  • oh, ja danke auch!


Anmelden zum Antworten