D
ds
Hello all,
I have a problem with calloc I have never seen before. I am migrating
some C code to C++ and at some part in the C code there is a calloc
that creates an array of structures. Now in the C++ version, the
structures are classes with virtual access functions. I am working on
linux with g++ and it seems that the _vptr part of the class is null.
Further use of these classes causes a segmentation fault. Of course if
I use new everything is ok. I wonder if this is a limitation of the
calloc implementation or if it is platform specific...
Thanks a lot!!
I have a problem with calloc I have never seen before. I am migrating
some C code to C++ and at some part in the C code there is a calloc
that creates an array of structures. Now in the C++ version, the
structures are classes with virtual access functions. I am working on
linux with g++ and it seems that the _vptr part of the class is null.
Further use of these classes causes a segmentation fault. Of course if
I use new everything is ok. I wonder if this is a limitation of the
calloc implementation or if it is platform specific...
Thanks a lot!!