Jeegar Patel
Jeegar Patel

Reputation: 27230

Any tool/IDE/script to limit my C code to a maximum of 80 characters per line?

I have so much C code. I need to edit that code to follow some coding line tips. So I need to limit all my C code to a maximum of 80 characters per line. Instead of editing each line of code, how can I perform this transformation with a tool/IDE/script?

Upvotes: 1

Views: 245

Answers (1)

iabdalkader
iabdalkader

Reputation: 17312

One such tool I know of is indent on Linux. It can be used to format your code in any style. Example from the man page:

The Linux style is used in the linux kernel code and drivers:

indent test/metabolism.c -linux

Another switch, more specific to your questions:

-ln, --line-lengthn

Set maximum line length for non-comment lines to n.

Upvotes: 5

Related Questions