I need to pass two arguments to a shell script, here is the code:
#include <stdio.h> #include <stdlib.h> void main() { char *script; int lines = 1; sprintf(script, "/...path.../line.sh %d %d", lines, lines); system(script); }
The script works well, ive tried it. But I always get a segmentation error. Question: why?
thanks
source share