End of file prob control and z

This is a discussion on End of file prob control and z within the C++ Programming forums, part of the General Programming Boards category; Does anyone know how I can possible stop control and z mucking up my code? Example below; const int MAX_BUFFER=256, ...

  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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21