Sign in to follow this  
GutyGu

Help! Where is the error?? :(

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this