Teen Programmers Unite  


Return to forum top

Array of classes

Posted by shrestha [send private reply] at September 29, 2002, 08:36:07 PM

I need to build an array of classes in C++ in UNIX
I have an array called calculate....
I now need to create an array of the class....something like:
calculate array[1000];

I tried this but it says : Segmentation fault when I run it.(it compiles fine though).

Is there any way I can do that?

Thank you.


Posted by Psion [send private reply] at September 29, 2002, 08:56:04 PM

You shouldn't get a segmentation fault with just that line unless your default constructor for calculate produces a segmentration fault when run 1000 times.

You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.