The Artima Developer Community
Sponsored Link

Java Answers Forum
Make a link between C programming and Java Application

2 replies on 1 page. Most recent reply: Jan 26, 2004 6:45 AM by Jacob

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Joseph Lee

Posts: 10
Nickname: at9483mph
Registered: Jan, 2004

Make a link between C programming and Java Application Posted: Jan 13, 2004 8:04 AM
Reply to this message Reply
Advertisement
I have a mathematical calculations program written in C programming and I try to translate it to Java but the application seem stop in the middle of the program running. I think maybe the value I used is too large or cannot be calculated using java according to one of my friend. I wonder is there possible to make connection between the C program and Java which mean I need to run the application from java and call the C program to do the calculation when is needed and return the result of the calculation to Java?

Is anyone can help me and please me some advise? I need it for my school final project.Thanks.


Ganesh A Baviskar

Posts: 1
Nickname: ganeshb
Registered: Jan, 2004

Re: Make a link between C programming and Java Application Posted: Jan 14, 2004 2:33 AM
Reply to this message Reply
Actually Java can handle much larger values than C, because it uses larger bits to store any datatypes as compaired to C. Still, you should try to use 'long' where you have used 'int' in your Java program and 'double' where you have used 'float'.
Again, put all the things in try...catch, so that if the Java program is throwing error, then you can get the error in console and solve it.

Best of Luck!!!

Regards,
Ganesh B.

Jacob

Posts: 4
Nickname: kimi
Registered: Jan, 2004

Re: Make a link between C programming and Java Application Posted: Jan 26, 2004 6:45 AM
Reply to this message Reply
Try using java Native interface..that should solve your problem as the java program calls C program you wrote and executes it

Flat View: This topic has 2 replies on 1 page
Topic: what's the difference ? Previous Topic   Next Topic Topic: Read file to JApplet in browser...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use