Advertisement

Limits??

Started by March 10, 2000 06:02 PM
1 comment, last by OneEyeLessThanNone 24 years, 7 months ago
Are there limits as to how many objects you can have in a function or program in c++? When I had 2 objects in my winmain it would complile but crash and exit when run. I moved one of the objects out of the winmain and made it global and it compiles and run flawlessly. Are there limits on memory for varialbes used in functions and if so what are they and how can they be altered. OneEyeLessThanNone - needs gramar school.
The only limit is essentially the virtual memory in your computer. There should be no reason that your program crashed just because you have two objects in your WinMain().
Advertisement
This might have nothing to do with it, but your do you have the objects or pointers to them? I think that making them global inicializes them with 0, so it might make the difference if you have some code like
if(lpobject1!=0)   lpobject1 = new object1;

This topic is closed to new replies.

Advertisement