Error: Program too big to fit to memory

Hello,
This is my first post and I'd love some help. I have WinXP SP3 and am using MinGW as my cpp compiler. I'm trying to write a cpp program that makes change in dimes and pennies given any int from 0 to 100.
Here's what I'm compiling, which gives the above named error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream.h>
#include <stdlib.h>

main() 
{
     int price, change, dimes, pennies;

     cout << "\nType price from 0 to 100";

     cin >> price;
     change = 100 - price;
     dimes = change / 10;
     pennies = change % 10;

     cout << "\nThe change is: " << dimes << " dimes" << pennies << " pennies";
}

Now I should mention that I've compiled one of the tutorial cpp progs made available to all by clicking 'Sourcecode' to the left on this page. It ran fine and everything seemed okay, including the extension '.cpp' which I can't get on any of my cpp programs. This also is an annoying mystery to me.

It works for me. Try this version.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

int main() 
{
     int price, change, dimes, pennies;

     cout << "\nType price from 0 to 100. "; 
     cin >> price;
     change = 100 - price;
     dimes = change / 10;
     pennies = change % 10;

     cout << "\nThe change is: " << dimes << " dimes and " << pennies << " pennies" << endl;
     system("PAUSE");
}


P.S. I know system("PAUSE") is bad practice, so yeah. You can change that to whatever else you like. I use it because nothing else works for me =(
Try this topic, I think that is what the problem is:

http://www.cplusplus.com/forum/windows/3430/
hey bluezor
I tried your version and got the same thing. It also wasn't recognized by Windows as a .cpp application. It got a .h. I've noticed all the .h s give "too big..etc'' but '.cpp's actually compile with mingw. I think I'm gonna find the bin file for vc++(since I have it on here also) and use that instead for cpp compiling. I feel kinda bad about that since mingw can supposedly do java, c and cpp. It seems like a waste. But its only a few million 0s and 1s right? Thanks for all and anymore help
I think OP should learn Windows before programming.
Try Dev C++
Really simple to use and works pretty well.
Topic archived. No new replies allowed.