[Áú¹®]²À ¾Ë·ÁÁֽñ⠹ٶø´Ï´Ù.


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :ÀåÅÂ±Ô 2000³â 5¿ù 10ÀÏ 08:08:27

¾È³çÇϼ¼¿ä.
Java ÇÁ·Î±×·¥¿¡¼­ C programÀ» ½ÇÇà ½ÃÅ°·Á°í ÇÕ´Ï´Ù. C program¿¡¼­ scanf()¸¦ »ç¿ëÇÏ¿© »ç¿ëÀÚ·Î ºÎÅÍ ÀÔ·ÂÀ» ¹ÞÀ¸¸é ´ÙÀ½À¸·Î ³Ñ¾î°¡°Ô ÇÏ·Á°í Çϳª C programÀÌ Ã³À½ºÎÅÍ ¸ØÃá»óÅ¿¡¼­ ´ÙÀ½À¸·Î ³Ñ¾î°¡Áö ¾Ê´Â ±º¿ä.
¾î¶»°Ô Çϸé À̹®Á¦¸¦ ÇØ°á ÇÒ ¼ö ÀÖ´ÂÁö ¾Æ½Ã´Â ºÐ ²À Á» ¾Ë·ÁÁÖ½Ã¸é °í¸¿°Ú½À´Ï´Ù.


program source code´Â ¾Æ·¡¿Í °°½À´Ï´Ù.


// Java Program
// Exec.java
import java.io.*;


public class Exec {
static public void main(String args[]) {
Runtime myRuntime = Runtime.getRuntime();
Process myProcess = null;
try{
myProcess = myRuntime.exec("abc"); // Execute abc ½ÇÇà file

/*
DataInputStream myInput =
new DataInputStream(new BufferedInputStream
(myProcess.getInputStream()));
*/

BufferedReader myInput =
new BufferedReader(new InputStreamReader
(myProcess.getInputStream()));


String buf = null;
while((buf=myInput.readLine()) != null)
System.out.println("From C"+ buf);



}catch(IOException e) {
System.out.println("JJJ"+ e.getMessage());
}
}
}



/* C program */
/* abc.c */
#include <stdio.h>
#include <stdlib.h>


int main(int argc, char **argv)
{
char name[128];


printf("Just came into abc.c\n");
printf("#Antony Bang\n");


printf("Enter your name\n");
scanf("%s", name);
printf("You entered %s\n", name);
printf("Just finished abc.c\n");


return (0);
}



´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]