Saturday, May 21, 2011

Code intendation

In linux, indenting the C code is very easy only if you happen to know tools for doing it. One such tool is "indent". It is a linux command that can be used to indent the C code. By default it indents the code in "gnu" style.
>indent file.c
 By using this command, we can even convert from one C style to another. For instance if you are acquainted to linux style of coding but you have a file that is in different style of coding, then use this command to convert the coding style to linux style of coding
>indent -linux file.c
Here, linux is an option to indent. There are many more options, so start exploring. 

No comments:

Post a Comment