T O P I C R E V I E W |
srmcarneir |
Posted - 03/31/2003 : 4:40:25 PM Hi,
I need to create strings dynamically and thought of encapsulating it in a structure and accessing that thru a linked list like this:
struct MyStruct { string strMyString; } MyStructure, *ptFirstMyStruct, *ptThisMyStruct;
Then I thought of using malloc and free to allocate memory dynamically as follows:
ptFirstMyStruct = (struct MyStruct *) malloc (sizeof ( struct MyStruct));
. . .
free ((void *) ptFirstMyStruct);
But OriginC compilator sent me an exception of "Integer divided by zero", when I was building. That crashed and finished the whole Origin application.
Is there any special attention to be paid to compilation time when using malloc/free functions? In fact I am a beginner at using these functions and probably my doubts concern of basic concepts on that...
[By the way, does OriginC support C++ routines?]
Best Wishes,
Ricardo Carneiro |
2 L A T E S T R E P L I E S (Newest First) |
srmcarneir |
Posted - 04/01/2003 : 5:59:45 PM Great News about next version of Origin, Mr. Yang! That will enhance the tool substantially.
In the meantime I guess I will live with some static allocation because the events in case are kind of predictable. I was just trying to improve my code. Best Regards!
Ricardo Carneiro |
cpyang |
Posted - 04/01/2003 : 09:23:12 AM quote: [By the way, does OriginC support C++ routines?]
Not sure what you are looking for. Origin C in Origin 7 does not support C++ but next version of Origin (Origin 8) will have substantial support of C++. There is also going to be an XML based Tree built-in to the language then, so that making a linked list would be a very simple matter.
CP
|
|
|