How to use c/c++ code in JAVA
Answers were Sorted based on User's Feedback
Answer / jaya prakash
Java Native Interface
is only correct ans.
it provide JNI.H header file.
only use method in java.
then
use the run command
javah -jni classname,
it creates classname.h header cpp file
we produce classname.cpp file
and
use run command
cl /LD classname.cpp
it produces .dll file
then
we compile and run java file
without using these steps u can't compile or run it.it
produces error because the method used in java is not
defined,,,
| Is This Answer Correct ? | 25 Yes | 3 No |
Answer / manchu
yes the above answer ids write but when i try to run the c
file i got an error as
'cl' is not recognized as an internal or external command,
operable program or batch file.
can anyone tell me whether i should include any directory
path ..
otherwise please tell me the steps that should be done
before running the c file
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / henk
What did you said?
why to run back in c/c++ when u r using java which includes
All the features of c/c++
C is much "deeper in the machine" than Java. In C, you can ask the value of a place in your memory wich you like. There are no boundry's!(well, windows don't like it, lets use the pingiun). Pointers are realy great and usefull, and C provide them. Java and pointers? Imposible!
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / guest
basically c is similar to java than c++, its better to use
the code in c which is very similar to java...
| Is This Answer Correct ? | 19 Yes | 20 No |
Answer / gaurav
why to run back in c/c++ when u r using java which includes
All the features of c/c++
| Is This Answer Correct ? | 6 Yes | 7 No |
int i=~0; uint j=(uint)i; j++; printf(“%d”,j);
what is the use of macro program
When the macros gets expanded?
swapping of two numbers without using third variable using AND and OR operators
How many types of arrays are there in c?
What is the size of array float a(10)?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
What does int main () mean?
discuss the steps needed to get a program from source code to executable in a system?
How we can set and clear bit in a byte using macro function?
in a town the percentage of men is 52 the percentage of total literacy is 48 if total percentage of literate men is 35 of the total population write a program to find the total no of the literate men and women if the population of the town is 80000
Add Two Numbers Without Using the Addition Operator