Quantcast
Channel: Pass variables to other functions in C - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Ajith C Narayanan for Pass variables to other functions in C

void outer_function(redisContext *c, redisReply **reply) { *reply = redisCommand(c, "MY-REDIS-COMMAND"); ... return; } int main(int argc, char **argv) { ... redisContext *c; redisReply *reply; ......

View Article



Answer by hyyking for Pass variables to other functions in C

Your struct expects values and you are passing a pointer, so the compiler can't assign a pointer as a redisContext. typedef struct { redisReply reply; // <- expects value redisContext c; // <-...

View Article

Pass variables to other functions in C

I have the following code in C: int main(int argc, char **argv) { ... redisContext *c; redisReply *reply; ... outer_function(...) return 0; } I would like to use the Redis variables in the...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images