cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Where is getopt
Where is getopt
Apr 17, 2021 at 2:41pm UTC
lostbits
(18)
Does anyone know where to find getopt?
Apr 17, 2021 at 2:53pm UTC
JustShinigami
(19)
getopt is in the header <unistd>, or if you want to use getopt_long its in the header <getopt.h>
https://www.gnu.org/software/libc/manual/html_node/Example-of-Getopt.html
that is a link to a small tutorial on how to use getopt, if you need one
Apr 17, 2021 at 2:57pm UTC
deleted account xyzzy
(5768)
In the non-standard
<unistd.h>
C header. Not every compiler has it, Visual Studio doesn't.
http://www.cplusplus.com/forum/general/141573/#msg747578
Apr 17, 2021 at 8:22pm UTC
lostbits
(18)
At the moment, I am using Visual Studio (only because Netbeans 12.4 seems to be having difficulty with C/C++). So, <unistd.h> is not available nor is <getop.h>.
Apr 17, 2021 at 8:30pm UTC
JustShinigami
(19)
if you google it, there are some workarounds ready to download.
https://www.codeproject.com/Articles/1940/XGetopt-A-Unix-compatible-getopt-for-MFC-and-Win32
this is a bit simpler than the original getopt, but depending on how you work with it, it might be enough.
Topic archived. No new replies allowed.