There is no such structure as
symboltab, the structure you've defined is named
symbol
Code:
struct symbol {
unsigned char type;
char *name;
}symbtab[TABLEN];
The following will work:
Code:
struct symbol *i=get_symbtab(test);
printf("%s\r\n",i->name);
Remember that unless you allocate *name for each array element, this will crash. If not all elements of the array will have the string, then recommend you initialize the entire array to zeros, then check to see if the pointer value for name is zero versus not before trying to print out that string. If you do not initialize to zeros or use calloc() then you'll have random (uninitialized) data in there and therefore the pointer value will also be random.