How to automatically generate function headers for .h file in Clion?

Maybe it’s a little late (about 4 years), but here’s the best way i’ve found (for a c file):

cut and paste the contents of the .c in the .h file, and for each function, put the cursor on it’s name and press Alt+Enter, and choose “Split function into declaration and definition”.

this will keep the declaration in the .h file while moving the implementation to the .c file.

hope it helps someone.

Leave a Comment