I've created one function which generates a code table and another function which performs a table look up based on some parameters which are passed through it. Eg.
generateCodeTable(int x, int y);
tablelookup(int z);
I've just realized that the variables created by the generateCodeTable function are out of scope and can't be accessed by tablelookup(). I could avoid this by initializing the variables before I call the generateCodeTable function but I was wondering if there was a more elegant way to implement it.
Thanks