felix
04-12-2005, 11:30 PM
Hello,
1 - Guys, about fscanf() I know I can limit the amount of data it will read, in this way for example i limit in 64 bytes
fscanf(fp, "%64s", buff);
I remeber I heard that is possible to pass a parameter to fscanf() that allow it to read strings with spaces, someone know how to do it? And can I use it together with the size delimiter (for example "%64s") ?
2 - I'm testing getopt(), it work cool, I'm using something like that
while ((c = getopt (argc, argv, "w:s:e:l:f:")) != EOF)
switch(c){
case 'x':
....
break;
}
It work fine. To get values from each switched value, but exist a way to create dependencies ?
For example
Suppose I want that:
'l' ONLY can be used if called with 'f'.
's' ONLY can be used if called with 'f'.
But yet, be able to call 'f' single. Can it be done via getopt() ?
ps: Examples are welcome.
3 - Exist a way to know what option of getopt() was choosed. Example, suppose it choosed 'w' and in sequence it entered in 's', can I from 's' case check if 'w' was entered by the user ? something like isgetopt(c); ? hhehehe
Thkz.
Regards again,
1 - Guys, about fscanf() I know I can limit the amount of data it will read, in this way for example i limit in 64 bytes
fscanf(fp, "%64s", buff);
I remeber I heard that is possible to pass a parameter to fscanf() that allow it to read strings with spaces, someone know how to do it? And can I use it together with the size delimiter (for example "%64s") ?
2 - I'm testing getopt(), it work cool, I'm using something like that
while ((c = getopt (argc, argv, "w:s:e:l:f:")) != EOF)
switch(c){
case 'x':
....
break;
}
It work fine. To get values from each switched value, but exist a way to create dependencies ?
For example
Suppose I want that:
'l' ONLY can be used if called with 'f'.
's' ONLY can be used if called with 'f'.
But yet, be able to call 'f' single. Can it be done via getopt() ?
ps: Examples are welcome.
3 - Exist a way to know what option of getopt() was choosed. Example, suppose it choosed 'w' and in sequence it entered in 's', can I from 's' case check if 'w' was entered by the user ? something like isgetopt(c); ? hhehehe
Thkz.
Regards again,