My evalit.c uses three helper functions: int getopnd(char *s, char *opnd) Given a string s such as "width*height" or "1001-x", getopnd copies the first operand from s into opnd. For the strings above, that would be "width" and "1001", respectively. getopnd returns the length of the string copied into opnd. As mentioned in an addendum in the a9 FAQs, you can assume that an operand will never be longer than 20 characters. int getvar(char *var) Returns the value of the variable 'var'. It uses a global variable, char **vars, that points into main's argv. If a variable is not found, getvar() calls exit(1). (But evalit's exit code is not checked.) int evalopnd(char *opnd) opnd is either a variable name, such as "width", or an integer, like "187", evalopnd returns the value, using either getvar() or the library routine atoi(). The main loop of my evalit.c is nearly identical to the main loop in my solution for a2/eval.java. See me or a TA if you don't have the a2 solutions. A minor design point: getvar() uses the global variable vars. I chose to use a global variable rather than passing vars as a parameter because I would have needed to pass vars through evalopnd, like this: int evalopnd(char *opnd, char **vars) { ... value = getvar(var, vars) } Because there's only ever one list of variables, it seems reasonable to make it a global.