c - How to check if a structure is initialized? -


i have table i'm implementing data structures. important block of code looks this(h data structure, table table stores other structures):

(h->table[hash(key, h->size)] 

while code running, table[i]'s initialized, , aren't. whenever test code on table[i] hasn't been initialized yet, valgrind error says can't work uninitialized array.

my question is, how check see if h->table[i] initialized or not?

you can't. fix problem, initialize struct before using (even if initialization set struct known "blank"/"not populated" state).


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -