相关疑难解决方法(0)

Optional arguments in C function

In a C function, I want to check if an input argument ('value' in my case) is presented or not.

i.e.:

void Console(char string[], int32_t value)
{
    // write string here
    // write value here, if it exists
}
Run Code Online (Sandbox Code Playgroud)

When used if(value != NULL) statement, my Console() function sends 4096

How can I check and act based on argument existence?

c arguments function

9
推荐指数
3
解决办法
2万
查看次数

__builtin_va_start在哪里定义?

我试图找到__builtin_va_start在GCC源代码中定义的位置,并查看其实现方式。(我一直在寻找va_start定义的位置,然后发现该宏定义为__builtin_va_start。)我cscope -r在GCC 9.1的源代码目录中使用它来搜索定义,但没有找到它。谁能指出该函数的定义位置?

gcc glibc

2
推荐指数
1
解决办法
168
查看次数

标签 统计

arguments ×1

c ×1

function ×1

gcc ×1

glibc ×1