The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Linked list

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000