I have a program that searches and outputs prime-numbers. I use linked-list to store these numbers (because I need to learn dynamic memory allocation). It's made of struct defined like this:
It works great. User enters a number and program searches through interval (0, number> and stores all prime-numbers found within this interval into my linked-list. Problem is, when user enters number greater than 25900 (or something near this). It crashes. Someone told me my problem are segments in memory. He told me I have only one memory segment available for allocating with new. I use new like this:Code:struct Tmylist { int value; Tmylist *next; };
and maybe I filled the segment. Could anyone help me?Code:Tmylist *beggining = new Tmylist;



LinkBack URL
About LinkBacks



I was just interesting in the difference between allocating in Console and in Win32. Thanx anyway...