Linked Questions
10 questions linked to/from getopt.h: Compiling Linux C-Code in Windows
13
votes
2
answers
30k
views
What is the alternative to getopt function on Windows c++? [duplicate]
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
13
votes
8
answers
25k
views
libzip with Visual Studio 2010
How can I compile libzip for Visual Studio 2010?
1
vote
2
answers
10k
views
Efficient String Parsing in C
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 ...
0
votes
2
answers
2k
views
Command line arguments without the hyphen
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]...
-2
votes
2
answers
2k
views
strcmp failing to compare strings properly
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(...
0
votes
1
answer
908
views
How to pass file path to program as argument if it runs from environment variable? C++
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 ...
0
votes
1
answer
633
views
compiling GCC project with visual studio [duplicate]
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 ...
1
vote
2
answers
488
views
How would I scan phrases from the command line?
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 ...
0
votes
2
answers
218
views
In C, how do I incorporate -o as a command line paramenter, to write output to another file rather than stdout?
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() ...
0
votes
1
answer
60
views
Parsing named command-line arguments on C (Windows)
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.
...