args.cc
来自「贝叶斯优化算法是一种新的演化算法」· CC 代码 · 共 44 行
CC
44 行
// ################################################################################
//
// name: args.cc
//
// author: Martin Pelikan
//
// purpose: functions for manipulation with arguments passed to a program
//
// last modified: February 1999
//
// ################################################################################
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "args.h"
// ================================================================================
//
// name: isArg
//
// function: checks whether there is a particular parameter in command line
// parameters
//
// parameters: s............the parameter to look for
// argc.........the number of arguments sent to the program
// argv.........an array of arguments sent to the program (including
// its name and the path)
//
// returns: (int) 1 if the parameter has been found, 0 otherwise
//
// ================================================================================
int isArg(char *s, int argc, char **argv)
{
for (int i=0; i<argc; i++)
if (!strcmp(s,argv[i]))
return 1;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?