M
Merrill & Michele
I am determining how best to call an already compiled c program from
another. The following is a program that compiles and shows the information
passed:
//Text1.cpp
#include <stdio.h>
int main(int argc, char* argv[])
{
int i;
for (i=0;i<=argc;i++)
printf("%d\t%s\n",i,argv);
return (0);
}
The following was my first attempt to call this program with something that
mimicks K&R §5.10. It compiles, but my linker didn't like it. Do I put it
in a separate project and hard code the path? Is there a better way to go
about this than a system call? Do I just forget about it and go get my
nails done? MPJ
//text2.cpp
#include <stdio.h>
#include <stdlib.h>
int main(int orange, char* apple[])
{
system("Text1 fruit flying Dutchmen");
return (0);
}
another. The following is a program that compiles and shows the information
passed:
//Text1.cpp
#include <stdio.h>
int main(int argc, char* argv[])
{
int i;
for (i=0;i<=argc;i++)
printf("%d\t%s\n",i,argv);
return (0);
}
The following was my first attempt to call this program with something that
mimicks K&R §5.10. It compiles, but my linker didn't like it. Do I put it
in a separate project and hard code the path? Is there a better way to go
about this than a system call? Do I just forget about it and go get my
nails done? MPJ
//text2.cpp
#include <stdio.h>
#include <stdlib.h>
int main(int orange, char* apple[])
{
system("Text1 fruit flying Dutchmen");
return (0);
}