我在这里面临的主要问题是在 VC 2010 ( )中strtoll()
被标记为错误。error C3861: 'strtoll': identifier not found
如果我用 替换它会做同样的事情strtol()
吗?
unsigned int get_uintval_from_arg(int argc, int index, char **argv,
unsigned int lower_bound, unsigned int upper_bound)
{
unsigned int return_val=0;
if (index + 1 <= argc - 1)
{
return_val=(unsigned int)strtoll(argv[index+1],NULL,10);
if (errno == EINVAL || errno== ERANGE)
{
fprintf(stderr, "Could not parse argument %s for switch %s!\n",
argv[index], argv[index+1]);
return 0;
}
}
// ....... I will post the remaining part of the code if necessary
.......
}