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 |
x=y=z=1 z=++x||++y&&++z Printf("%%%d";xyz) what is the values of x,y and z?????
What is a stream?
What is masking?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
11 Answers HCL, Vector, Vector India, Vector Solutions, Wipro,
In which category does main function belong??
Explain what is the difference between text files and binary files?
we have a 3litres jug and a 5 litres jug and no measures on them. using these two jugs how can we measure 4 litres of water?
void main() { for(; 0 ;) ... { printf("hello"); ... } getch(); }
Why ca not I do something like this?
Rapunzel walks into the forest of forgetfullness. She meets a Lion who lies on Monday Tuesdays and Wednesdays and meets a rabbit who lies on Thurs fridays and saturdays . On that day both say that "I lied yesterday". What day is it .
What are header files and explain what are its uses in c programming?
What is define directive?