$ grep --include=\*.c -rnw '/path/to/somewhere/' -e "pattern"
$ grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"