What does _(“text”), i.e. underscore bracket char, do? [duplicate]

It is calling the function called _. For instance:

#include <stdio.h>

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

_ is an existing function in gettext library and is used for internationalization. As said in 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).

Leave a Comment