Linked Questions

13 votes
2 answers
30k views

The code below I'm using Posix C: while ((opt = getopt(argc, argv, "a:p:h")) != -1) How can I port this code to Windows C++ using an alternative function? Thanks
Jones Jardel Poersch's user avatar
13 votes
8 answers
25k views

How can I compile libzip for Visual Studio 2010?
judeclarke's user avatar
  • 1,116
1 vote
2 answers
10k views

I'm implementing some C getter/setter for an embedded system which takes a C string as an input. I need to parse out some commands, ex: command, option, option, option. The options themselves will ...
FourierFlux's user avatar
0 votes
2 answers
2k views

How can I parse arguments without the hyphen in C? I.e. virsh install vm or git pull origin master When I tried it out, if there is no - prefix, everything just gets ignored and argc returns 1 (argv[0]...
jayjay's user avatar
  • 1,037
-2 votes
2 answers
2k views

I'm having trouble using strcmp in C. I'm trying to compare a program's arguments using strcmp but even though the strings are the same it doesn't work. Here is the portion of code. while(strcmp(...
Atirag's user avatar
  • 1,750
0 votes
1 answer
908 views

Im making college project to code and decode files. I want it to run from command line something like this: myapp file_name -code myapp file_name -decode How do I get path to file in directory where ...
PING_LORD's user avatar
0 votes
1 answer
633 views

I have a project that compiling with GCC, and now I want open and run it with visual studio.what should I do? I created new C project in visual studio and then add .c files to Source Files and add .h ...
sara khanoumi's user avatar
1 vote
2 answers
488 views

I am currently trying to get my program to work the way I want. I am currently at the point where I can open up any text file from the command line (an unlimited amount) and display them. I'd like to ...
user1886339's user avatar
0 votes
2 answers
218 views

I currently have a program, myprogram.c, that can be invoked with command line arguments such as myprogram testfile. This will read in text from testfile, assuming it exists, and the function spaces() ...
jtuntalan's user avatar
0 votes
1 answer
60 views

I'm currently developing a tool on Windows with Visual Studio with C, however I've noticed that I cannot import libraries such as unistd.h into my source file for command-line argument parsing. ...
sunflower's user avatar