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:
If you can read English, check the English part of the site.