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 |
m=++i&&++j(||)k++ printf("%d"i,j,k,m)
What are void pointers in c?
What is realloc in c?
What is pre-emptive data structure and explain it with example?
What should not contain a header file?
Why is c faster?
What is calloc()?
write a program for even numbers?
how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48
What is a stream in c programming?
What will be the result of the following program? main() { char p[]="String"; int x=0; if(p=="String") { printf("Pass 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } else { printf("Fail 1"); if(p[sizeof(p)-2]=='g') printf("Pass 2"); else printf("Fail 2"); } } a) Pass 1, Pass 2 b) Fail 1, Fail 2 c) Pass 1, Fail 2 d) Fail 1, Pass 2 e) syntax error during compilation
What are the three constants used in c?