You will need to use the -o switch each time you call cc:
cc -o path/to/my/file/a.out path/to/my/file/example.c
or you can do a wrapper script like this:
mycc
#!/bin/bash
dirname=`dirname "$1"`
cmd="cc -o \"$dirname/a.out\" \"$1\""
eval $cmd
./mycc path/to/my/file/example.c
, ,
cc -o "path/to/my/file/a.out" path/to/my/file/example.c
, mycc $PATH, :
mycc path/to/my/file/example.c