I am trying to pass a string as a parameter from PHP to a c file, using exec()
Here's the PHP:
Code:
$mystring = "foobar";
echo exec('./cairo21 -a $mystring');
That goes fines.
The problem is when I am trying to accept the string into my compiled c file:
C Code:
Code:
char webcompanyname[256] = getopt(argc,argv, "a:");
Compiler: error: invalid initializer
cairo21.c:69:2: warning: initialization makes integer from pointer without a cast.
Apparently getopt returns an integer. Is that integer a pointer to the string? Thoughts greatly appreciated.