How to import arguments to system() function
I need to create a iso fs using a C pgm. I can do it juz by calling system("mkisofs ---"); but how I can make it user interactive by providing arguments(variables) to this function
|
Try something as follows:
Code:
char s[100]; |
Thanx nixcraft,
But I 've got a problem. A warning message like " passing arg 1 of fprintf from incompatible pointer type " is displayed and the pgm problably is not working. How to fix it out. |
Actually, you'd want to use sprintf, not fprintf. fprintf is for printing to file handles/streams. Secondly, when getting user input, one should never use an input routine that does not restrict the # of chars the user is allowed to enter.
Code:
char s[100]; One reason for this is in the system man page: Quote:
|
Opps :o it should be sprintf and not fprintf sorry...
here is the right one Code:
#include<stdio.h> |
Thanx for u all,
It did really work |
All times are GMT -5. The time now is 12:30 AM. |