Aritra Mukherjee Aritra Mukherjee - 1 year ago 90
C Question

'c' file handling program

can anyone give any idea about how to write a program to indent a 'c' source code in a file?

Answer Source

is it possible

  • yes, but not easy. There are lots of IDEs that try, and some do better than others.

comments are not taken into consideration

they have to be. Let's look at the code

void foo()
/** {this does something **/
{ baz(); }

you need to register that the { is in a comment, else you'll end up with everything with an extra tab, and a non-matching { at the end.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download