Jump to content
  • Advertisement
Sign in to follow this  
GutyGu

Help! Where is the error?? :(

This topic is 4427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Guys! I'm trying to make a little program with a menu using a for (;;) loop. When I compile it, it says: _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. _32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h Permission denied _32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h ld returned 1 exit status The first line appears everytime i compile a program.. but it compiles anyway without problems. The last two lines don't let me compile it now. Which is the error here? Here is the code:
#include <iostream.h>

enum BOOL { FALSE, TRUE };

typedef unsigned short int USHORT;

USHORT Menu();
void DoTaskOne();
void DoOtherTasks(USHORT opcion);

int main()
{
    BOOL exit = FALSE;
    
    for (;;)
    {
        USHORT opcion = Menu();

        switch(opcion)
        {
            case (1):
                     DoTaskOne();
                     break;
            case (2):
                     DoOtherTasks(2);
                     break;
            case (3):
                     DoOtherTasks(3);
                     break;
            case (4):
                     break;
            case (5):
                     exit = TRUE;
                     break;
            default:
                     cout << "Por favor, ingrese una opcion correcta." << endl;
                     break;
        }
    
        if (exit)
            break;
        }
    return 0;
}

USHORT Menu()
{
    int opcion;
    
    cout << "*------Menu------*" << endl;
    cout << "Opcion (1)" << endl;
    cout << "Opcion (2)" << endl;
    cout << "Opcion (3)" << endl;
    cout << "Opcion (4)" << endl;
    cout << "Opcion (5)" << endl;
    cout << endl;
    cout << "Que opcion elige?: ";
    cin >> opcion;
    
    return opcion;
}

void DoTaskOne()
{
    cout << "Elegiste la opcion uno!!" << endl;
}

void DoOtherTasks(USHORT opcion)
{
    if (opcion == 2)
        cout << "Elegiste la opcion dos!!" << endl;
    else
        cout << "Elegiste la opcion tres!!" << endl;
}
Thank u all :)

Share this post


Link to post
Share on other sites
Advertisement
I put #include <iostream> and it doesn't recognize "cout" and "cin".

I'm using DevC++ 4.9.9.2

Moderators, can you delete this post? i don't know why i posted twice this thread. The other one is written better with Source tags.

Thank u!

[Edited by - GutyGu on June 6, 2006 2:30:45 PM]

Share this post


Link to post
Share on other sites
try std::cout, std::endl and std::cin

or

"using namespace std;" before you use cin and cout

like the previous poster said, it should also be #include <iostream>

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!