Go backward to The symbol table.
Go up to Basics of adding C code.

Utility functions
-----------------

  
There are several useful utility functions built into Soar that might be
helpful in your code.  The most important are print() and
print_with_symbols().  Print() works exactly like C's printf() function, only
instead of just writing to standard output (the screen), print() also writes
to the current log file (if there is one).  Print_with_symbols() is sort of
like print(), but it doesn't handle any of the standard C "%" escapes.  The
only escape it handles is "%y", which prints an arbitrary symbol.  For
example:

Symbol *sym1, *sym2;
int i;
char *name;
...
print ("i=%d and name=%s\n", i, name);
print_with_symbols ("sym1=%y and sym2=%y\n", sym1, sym2);

Note that print() handles *everything except* symbols, while
print_with_symbols() handles *nothing but* symbols.

There are numerous other Soar functions you might want to use, but I refer
you to soar.h rather than list them here.  (Of course, you should read the
comments and/or source code and make sure you understand them before using
them.) The memory allocation utilities are particularly helpful.