I have seen it used twice already in different libraries as an abbreviation, but I can't wrap my head around what it should mean.

For example here:

static int reformat_string(void * ctx, const unsigned char * stringVal,  
                       size_t stringLen)  
{  
    yajl_gen g = (yajl_gen) ctx;  
    return yajl_gen_status_ok == yajl_gen_string(g, stringVal, stringLen);  
}  

As far as I can tell, it is usually used for structs.

有帮助吗?

解决方案

It typically stands for "context". Usually this is some structure that gets passed around to functions in a library, used to maintain state (i.e., the context of the function call).

It's a preferable alternative to using global variables.

其他提示

By acronymsandslang.com It means "context". But You can look for other CTX meaning there

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top