Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WINDOWS Directory Pin
Ehsan Baghaki20-Apr-05 21:00
Ehsan Baghaki20-Apr-05 21:00 
GeneralPlease help me! Pin
dSolariuM16-Apr-05 6:42
dSolariuM16-Apr-05 6:42 
GeneralRe: Please help me! Pin
22491716-Apr-05 7:06
22491716-Apr-05 7:06 
GeneralRe: Please help me! Pin
Alexander M.,16-Apr-05 10:02
Alexander M.,16-Apr-05 10:02 
GeneralRe: Please help me! Pin
dSolariuM18-Apr-05 4:27
dSolariuM18-Apr-05 4:27 
Generalplz help me in dis code!! Pin
Member 188014616-Apr-05 4:23
Member 188014616-Apr-05 4:23 
GeneralRe: plz help me in dis code!! Pin
Alexander M.,16-Apr-05 9:57
Alexander M.,16-Apr-05 9:57 
GeneralRe: plz help me in dis code!! Pin
David Crow16-Apr-05 17:15
David Crow16-Apr-05 17:15 
This slight modification to your code will get you closer to your end result:

void main( void )
{
    int i,
        j,
        nNumber,
        a[10] = {0};
    
    for (i = 0; i < 10; i++) 
    { 
        do
        {
            cout << "Enter a number between 20 and 100: ";
            cin >> nNumber;
        } while (nNumber < 20 || nNumber > 100);
 
        // search for the number, or the next 'empty' spot, in the array
        for (j = 0; j < i; j++)
        {
            if (a[j] == nNumber || a[j] == 0)
                break;
        }
 
        // if the number was not found
        if (a[j] == 0)
            // add the number to the array
            a[j] = nNumber;
    }
 
    cout << "The non-duplicate numbers:" << endl;
    
    for (j = 0; a[j] != 0; j++) 
        cout << a[j] << endl;
    
    getch();
} 



"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow


GeneralHelp with derived class Pin
ddmcr16-Apr-05 4:12
ddmcr16-Apr-05 4:12 
GeneralRe: Help with derived class Pin
John M. Drescher16-Apr-05 4:59
John M. Drescher16-Apr-05 4:59 
GeneralRe: Help with derived class Pin
ddmcr16-Apr-05 5:09
ddmcr16-Apr-05 5:09 
GeneralRe: Help with derived class Pin
John M. Drescher16-Apr-05 5:32
John M. Drescher16-Apr-05 5:32 
GeneralRe: Help with derived class Pin
David Crow18-Apr-05 4:26
David Crow18-Apr-05 4:26 
GeneralRe: Help with derived class Pin
Blake Miller18-Apr-05 8:29
Blake Miller18-Apr-05 8:29 
GeneralRe: Help with derived class Pin
David Crow18-Apr-05 9:32
David Crow18-Apr-05 9:32 
GeneralRe: Help with derived class Pin
Blake Miller18-Apr-05 9:54
Blake Miller18-Apr-05 9:54 
GeneralRe: Help with derived class Pin
David Crow18-Apr-05 10:06
David Crow18-Apr-05 10:06 
GeneralButton Create Pin
Francis Chau16-Apr-05 4:06
Francis Chau16-Apr-05 4:06 
GeneralRe: Button Create Pin
PJ Arends16-Apr-05 6:37
professionalPJ Arends16-Apr-05 6:37 
GeneralRe: Button Create Pin
Francis Chau16-Apr-05 18:15
Francis Chau16-Apr-05 18:15 
Questionhow to recognize &quot;real&quot; printer in EnumPrinters? Pin
sstoyan16-Apr-05 3:52
sstoyan16-Apr-05 3:52 
AnswerRe: how to recognize &quot;real&quot; printer in EnumPrinters? Pin
Alexander M.,16-Apr-05 11:20
Alexander M.,16-Apr-05 11:20 
GeneralRe: how to recognize &quot;real&quot; printer in EnumPrinters? Pin
sstoyan17-Apr-05 4:43
sstoyan17-Apr-05 4:43 
Generalencryption symetric Pin
3loka16-Apr-05 2:15
3loka16-Apr-05 2:15 
GeneralRe: encryption symetric Pin
22491716-Apr-05 2:21
22491716-Apr-05 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.