Only link libm for wc.
Use pointer arithmetic rather than address of.