uユ
#include <libcommon/clopt.h>
int main(int argc, char **argv)
{
if(CL_argindex(argc, argv, "-arg")) {
const char *p = CL_getparam(argc, argv, "-arg");
if(p) {
printf("-arg is '%s'\n", p);
}
}
return 0;
}
-arg -something
- CL_getparam вернет NULLSize: a a a
uユ
#include <libcommon/clopt.h>
int main(int argc, char **argv)
{
if(CL_argindex(argc, argv, "-arg")) {
const char *p = CL_getparam(argc, argv, "-arg");
if(p) {
printf("-arg is '%s'\n", p);
}
}
return 0;
}
-arg -something
- CL_getparam вернет NULLuユ
/¯
#include <libcommon/clopt.h>
int main(int argc, char **argv)
{
if(CL_argindex(argc, argv, "-arg")) {
const char *p = CL_getparam(argc, argv, "-arg");
if(p) {
printf("-arg is '%s'\n", p);
}
}
return 0;
}
#include <libcommon/clopt.h>
int main(int argc, char **argv)
{
if(int idx = CL_argindex(argc, argv, "-arg"))
{
const char *p = argv[idx];
if(p) printf("-arg is '%s'\n", p);
}
return 0;
}
uユ
#include <libcommon/clopt.h>
int main(int argc, char **argv)
{
if(int idx = CL_argindex(argc, argv, "-arg"))
{
const char *p = argv[idx];
if(p) printf("-arg is '%s'\n", p);
}
return 0;
}
uユ
uユ
M
M
M
uユ
uユ
uユ
/¯
uユ
M
M
M
M
uユ
uユ