How to use c/c++ code in JAVA

Answers were Sorted based on User's Feedback



How to use c/c++ code in JAVA..

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

How to use c/c++ code in JAVA..

Answer / mohmedali

use c/ c++ linkage specifications

Is This Answer Correct ?    12 Yes 4 No

How to use c/c++ code in JAVA..

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

How to use c/c++ code in JAVA..

Answer / thangavelbalu

Using "native" keyword

Is This Answer Correct ?    9 Yes 2 No

How to use c/c++ code in JAVA..

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

How to use c/c++ code in JAVA..

Answer / skm

C C++ Language C C++ Language

Is This Answer Correct ?    3 Yes 2 No

How to use c/c++ code in JAVA..

Answer / ramu

in the form of headerfiles

Is This Answer Correct ?    11 Yes 11 No

How to use c/c++ code in JAVA..

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

How to use c/c++ code in JAVA..

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

How to use c/c++ code in JAVA..

Answer / devendra

NO IDE USE IN C++ PLSE HELP ME

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More C Interview Questions

m=++i&&++j(||)k++ printf("%d"i,j,k,m)

1 Answers   ABC,


What are void pointers in c?

0 Answers  


What is realloc in c?

0 Answers  


What is pre-emptive data structure and explain it with example?

0 Answers  


What should not contain a header file?

2 Answers  






Why is c faster?

0 Answers  


What is calloc()?

0 Answers   Adobe,


write a program for even numbers?

19 Answers   TCS,


how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48

1 Answers  


What is a stream in c programming?

0 Answers  


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

10 Answers   IBM,


What are the three constants used in c?

0 Answers  


Categories