Quantcast
Viewing all articles
Browse latest Browse all 3

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;    // <- expects value
} redisStuff;

...

redisContext *c;
redisReply *reply;

redisStuff rs = { reply, c };  // <- reply and c are pointers

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>