You might have accidently deleted the appropriate extensions from the filetypes list.
To check this, right-click on your project (in the management pane), choose "Project tree -> Edit file types & categories" and check the content of the category "Sources".
The easiest way to fix this would be to remove the default.conf file from ~/.codeblocks on linux or %APPDATA%\codeblocks on windows.