java.lang.Runtime()
I made a small addition program using 'C'. It accepts 2 no.s and produces the result.
how can i send the 2 no.s to the C program? Here is the code i tried:
Runtime r=Runtime.getRuntime();
Process p=r.exec("add.exe");
InputStream ios=p.getInputStream();
OutputStream ops=p.getOutputStream();
String a="1\n", b="2\n", text;
ops.write(a.getBytes());
ops.write(b.getBytes());
BufferedReader br=new BufferedReader(InputStreamReader(ios));
while ( (text=br.readLine())!=null)
System.out.println(text);
I'm neither getting any output nor any error. What do i do? Plz help and thanks in advance.

