What does this mean?

This is a discussion on What does this mean? within the C++ Programming forums, part of the General Programming Boards category; I am using a compiler called Quincy 99 and when I try to run my program I get this error. ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    19

    What does this mean?

    I am using a compiler called Quincy 99 and when I try to run my program I get this error.

    (gcc.exe: cannot specify -o with -c or -S and multiple compilations)

    Here is my program:


    #include <iostream.h>

    void main()
    {
    const in MAX = 50;
    int count = 0;
    int index = 0;
    float numbers_array[MAX];
    char ch = 'Y';
    int max;
    int min;
    int i = 0

    do
    { while(ch == 'Y' || ch == 'y')
    {
    cout << "Please enter a number: ";
    cin >> numbers_array[index];
    index++;
    count++;
    cout << "Do you want to enter another number? (Y/N) ";
    cin >> ch;
    }

    min = number_array[0];
    max = number_array[0];

    while (i < MAX)
    {
    if (number_array[i] < min)
    {
    min = number_array[i];
    }

    else (number_array[i] > max)
    {
    max = number_array[i];
    }
    i++
    }

    cout << "You entered a total of" << count;
    cout << "numbers." <<endl;
    cout << "The largest number you entered was " << max << endl;
    cout << "The smallest number you entered was " << min << endl;
    cout << "Do you want to re run this program? (Y/N);
    cin >> ch;
    }
    while (ch == 'Y' || ch == 'Y')

    return 0;
    }


    what am I doing wrong?

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    Well, I'm not familiar with gcc, so I can't tell you what your error means, but there are several other problems with your program.

    > void main()

    main returns an int, not void

    > const in MAX = 50;

    int, perhaps?

    > int i = 0

    You forgot the semicolon

    > i++

    No semicolon again

    > (ch == 'Y' || ch == 'Y')

    You probably mean (ch == 'Y' || ch == 'y')

    >min = number_array[0];
    >max = number_array[0];

    You declared it as numbers_array

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    19

    thanks

    I will make the corrections and see what happens

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    19

    Angry Still got the same error

    #include <iostream.h>

    int main()
    {
    const int MAX = 50;
    int count = 0;
    int index = 0;
    float numbers_array[MAX];
    char ch = 'Y';
    int max;
    int min;
    int i = 0;

    do
    { while(ch == 'Y' || ch == 'y')
    {
    cout << "Please enter a number: ";
    cin >> numbers_array[index];
    index++;
    count++;
    cout << "Do you want to enter another number? (Y/N) ";
    cin >> ch;
    }

    min = numbers_array[0];
    max = numbers_array[0];

    while (i < MAX)
    {
    if (number_array[i] < min)
    {
    min = number_array[i];
    }

    else (number_array[i] > max)
    {
    max = number_array[i];
    }
    i++;
    }

    cout << "You entered a total of" << count;
    cout << "numbers." <<endl;
    cout << "The largest number you entered was " << max << endl;
    cout << "The smallest number you entered was " << min << endl;
    cout << "Do you want to re run this program? (Y/N);
    cin >> ch;
    }
    while (ch == 'Y' || ch == 'y')

    return 0;
    }

  5. #5
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    The error doesn't have anything to do with the code corrections - I only fixed minor typographical errors. It's something to do with the way you're compiling it.

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