Command line parameter
I need to get one command line parameter -nv in my program made with DJGPP, but how? I don''t know how getopt works and the example source doesn''t work either.
Well, getopt is actually provided primarily as a way to help streamline porting linux/unix apps to dos. The easiest way to do this is to simply write your own code to check the command line parameters.
If I understand correctly, does this help?
YAP-YFIO,
deadlinegrunt
|
YAP-YFIO,
deadlinegrunt
~deadlinegrunt
Here I know this works..
|
------------------------------------------------------------I wrote the best video game ever, then I woke up...
getopt is really easy, although I have only used the linux version but I think they work the same, so telnet to your nearest linux server and type "man getopt"
Gyzmo
=======================
Meddle not in the affairs of dragons for you are crunchy and go well with toast.
Gyzmo
=======================
Meddle not in the affairs of dragons for you are crunchy and go well with toast.
Gyzmo=============================="Well is the world standard" - The Alchemist"Not in Canada!" - jonnyfish
Or if you have Rhide you can use the libc reference (you can find it in the help menu) to find out how to use getopt()
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
quote:
Original post by Muzzafarath
Or if you have Rhide you can use the libc reference (you can find it in the help menu) to find out how to use getopt()
Thanks for all help. I found out the solution from one of my older sources.. there the second parameter of int main() is actually char *argv[] but I guess it''s same as char **argv
I have Rhide, but the example source for getopt() doesn''t work.
I don''t have access to Linux. Thank god
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement