Thread: I don't understand this error...

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    195

    I don't understand this error...

    Okay I'm just writing a short piece of code to figure out a math problem

    Code:
    #include <iostream.h>
    
    void main() {
    	int num;
    	int num2;
    	int sum=0;
    
    	cout<<"Enter num: ";
    	cin>>num;
    	
    	num2=num*2;
    
    	for (int i=1; i<num2; i++) {
    		if (num2%i==0 && num%i!=0) {
    			sum+=i;
    		}
    	}
    
    	cout<<sum<<endl;
    }
    It compiles fine but it gives me the runtime error up to the part that inputs the data then crashes. Similary if i just put 1 statement in the main like "cout<<"blah"<<endl; then it still crashes:

    Code:
    Loaded 'ntdll.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
    The thread 0x7C4 has exited with code 4373080 (0x42BA58).
    The program 'D:\C++\MathTesting\Debug\test.exe' has exited with code 4373080 (0x42BA58).
    Last edited by KneeGrow; 11-15-2004 at 11:58 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM