struct - Using one typedef to use on two different data types in C? -


if have struct below, can use void ** pointer if don't know type of object point to?

typedef struct {    ... many other things defined here     void ** pointer;  }; 

if pointer array can either int or struct, possible encapsulate both in single typedef above? best solution can think of making 2 different typedefs, each accommodate either possibility:

typedef struct {    ... many other things defined here     struct ** pointer_struct;     int ** pointer_int;  };  typedef struct b {    ... same many other things defined here     int ** pointer_int;  }; 

or single struct accommodate both possibility either pointer_int or pointer_struct null:

typedef struct {    ... many other things defined here     struct ** pointer_struct;     int ** pointer_int;  } ;    


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -