_(“text”),即下划线括号char,做什么?

在C代码中,我遇到了这个问题
_("test")

它有什么作用? (我试着自己查一下,但是你可以想象,搜索引擎不支持搜索…)

解决方法

它正在调用名为_的函数.例如:
#include <stdio.h>

void _(int a) {
    printf("%d",a);
}
int main(void) {
         _(3);
        return 0;
}

_是gettext library中的现有函数,用于国际化.如this answer所述:

This function basically replaces the given string on runtime with a translation in the system’s language,if available (i.e. if they shipped a .mo file for this language with the program).

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些