dcsimg
How to use in java a linked list programmed in C?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, October 9, 2002 06:36 AM

I need to use a linked list in a java program, but as java does not support pointers, I have though to program it in C. The problem here, is that I have seen that is possible to write functions in C and call them from a java program, but I want not only to call to the insert and delete methods to the list. I need that the contents in the list remains unchanged from a call to the next and I need to use the C functions to get and release the memory. Can you say me if this is possible? Can you suggest me how to implement this? I know that java includes the LinkedList class, but I prefer program this functionality by myself due to I have made this several times in C and it is very easy and fast. Many thanks.    More>>

I need to use a linked list in a java program, but as java does not support pointers, I have though to program it in C. The problem here, is that I have seen that is possible to write functions in C and call them from a java program, but I want not only to call to the insert and delete methods to the list. I need that the contents in the list remains unchanged from a call to the next and I need to use the C functions to get and release the memory. Can you say me if this is possible? Can you suggest me how to implement this?

I know that java includes the LinkedList class, but I prefer program this functionality by myself due to I have made this several times in C and it is very easy and fast.


Many thanks.

José Fernández

   <<Less

Re: How to use in java a linked list programmed in C?

Posted By:   David_Liu  
Posted On:   Wednesday, October 9, 2002 11:10 AM

It's just as easy using LinkedList. I would think you would spend more time researching on how to call your C program then it would take you to code it in Java.


Besides, are you going to resort to coding all your algorithms in C for your future Java projects?


Also, I am not sure if your company has an extensive developement staff with C knowledge, but do you want to support your application for the rest of your life? or coding in a standard way so others can support your application?

Re: How to use in java a linked list programmed in C?

Posted By:   Lasse_Koskela  
Posted On:   Wednesday, October 9, 2002 07:55 AM

Using JNI just to implement a linked list sounds a bit redundant, in my opinion.


What's wrong with the java.util.LinkedList implementation? Is it too slow for your needs?

About | Sitemap | Contact