posted 23 years ago
Hi,
In C there is a function called System(char *). U can make use of this to execute a OS command. The question remains how to pass an array. U can do it by passing the contents of the array as command line parameters to the java program.
ex.
suppose ur java class name is Call and u want to pass an array arr[4]= {1,2,3,4} elements to the java program, Then use the function call system as
Char *params;
Char *temp;
Char *cmd = "java Call ";
for (i=0;i<=3;i++)
{
temp = itoa(arr[i]);
params = strcpy(params,temp);
}
strcpy(cmd,params);
System(cmd);
Just be sure u have allocated sufficient memory for the three char pointers.
And after that in Java program u can easily parse these parameters the way u need.
I think this will solve ur problem.
Pls mail me back abt this,
Rgds,
Shantanu