c - 有谁知道这个 "typedef long long int (stoll_t)(const char *, char **, int);"是什么?

标签 c c++14

<分区>

我在浏览代码库时发现了这个

typedef long long int (stoll_t)(const char *, char **, int); 

不知道它的作用是什么? 以及如何调用这个函数?

在代码中是这样的

long long int argtoll( const char *str, const char **end, stoll_t stoll); //this 

最佳答案

typedef long long int (stow)(const char *, char **, int);stow 定义为一个类型。

那个类型是 function (pointer to const char, pointer to pointer to char, int) returning long long int .

long long int example_function_of_that_type(const char *a, char **b, int c) {
  if (a == NULL) return 1;
  if (b == NULL) return 2;
  return c;
}

关于c - 有谁知道这个 "typedef long long int (stoll_t)(const char *, char **, int);"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54725800/

相关文章:

c++ - std::make_integer_sequence 究竟是如何实现的?

c - 使用指针的段错误(核心转储)

在 linux 内核中请求相对较大的大小时,无法从 `flex_array_alloc` 分配内存

c++ - C/C++ 中登录客户端软件的标准方法是什么?

c - OCI_INVALID_HANDLE - 无效的服务上下文、连接或语句句柄

c++ - 条件类型别名定义

c - in_addr 数组

c++ - 泛型函数的重载可以对其他重载开放吗?

c++ - 生成一个拷贝作为采用右值引用的函数的输入

c++ - 在启动时填充全局静态数组