
-----------------------------------
Flikerator
Fri Nov 04, 2005 9:40 am

Error excecuting?
-----------------------------------
Near like the beggining my program just crapped out and after I did the input it shut down saying the program was succesful. Im not entirely sure why though. I wrote the rest of the program anyways, without being able to test it. Any help would be appreciated.

The program is supposed to find all the factors in both numbers and compare to see how many of those numbers are the same. Then it checks if they have 2 or more numbers with the same factors, and reports it.


#include 

int main()
{
    int num1, num2, count,numHold = 0;
    std::cout > num1;
    std::cin.ignore();
    std::cout > num2;
    std::cin.ignore();
    
    if (num1 > num2){
       numHold = num1;         
    }
    else{
         numHold = num2;
    }
    int fact[numHold][2];
    
    for (int i=1; i < 2; i = i + 1){
        for (int ii=1; i < numHold+1; ii = ii + 1){
            fact[ii][i] = 0;    
        }    
    }
    
    for (int i = 1; i < num1+1; i = i+1){
        if (num1 % i < 1){
            fact[i][1] = 1;       
        }
    }
    for (int i = 1; i < num1+1; i = i + 1){
        std::cout 