Finds recursively all files having extension .c, .h in '/path/' that contain 'pattern', and prints matched strings with string number and file name.
grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"