To find all *.h and *.c files in directory <directory> and its subdirectories, containing string <string>:
grep -e "<string>" -rn --include=*.{h,c} <directory>
with: