Shared Memory allocated with preprocessor variables

Converted the program to use preprocessor variables to allocate the
shared memory