Thread: End of file prob control and z

  1. #1
    Registered User subdene's Avatar
    Join Date
    Jan 2002
    Posts
    359

    End of file prob control and z

    Does anyone know how I can possible stop control and z mucking up my code? Example below;

    const int MAX_BUFFER=256, MAX_LEVEL=10;

    void main()
    {
    char Buffer[MAX_LEVEL][MAX_BUFFER];

    int Level=0;

    for(Level; Level < MAX_LEVEL; Level++)
    {
    cout << "Please enter password for level " << Level+1 << ": ";

    cin.clear(); //Clear fail bit if stream errors
    cin.get(Buffer[Level],MAX_BUFFER,'\n');
    cin.ignore();

    cout << endl;
    }
    }

    Thanks in advance.
    Be a leader and not a follower.

  2. #2
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    if you don't want ctrl+c then put BREAK=OFF in your config.sys and restart. (windows os assumed)
    -

Popular pages Recent additions subscribe to a feed