2022-07-03 misc MoreAboutC Notes for C 语言编程透视Format your C code12$ indent -kr file.c # format C source code according to K&R format$ man indent # more style Before123456789101112#include <stdio.h>#include <dirent.h>int main(){ FILE * fp = fopen("/root/.cache/test/mountpoint/file1","r"); char line [1000]; while( fgets(line, 1000, fp) ){ puts(line); } DIR * dp = opendir("/root/.cache/test/mountpoint/mydir"); struct dirent * entry ; while( (entry = readdir(dp)) != NULL ){ puts(entry->d_name); }} After1234567891011121314151617#include <stdio.h>#include <dirent.h>int main(){ FILE *fp = fopen("/root/.cache/test/mountpoint/file1", "r"); char line[1000]; while (fgets(line, 1000, fp)) { puts(line); } DIR *dp = opendir("/root/.cache/test/mountpoint/mydir"); struct dirent *entry; while ((entry = readdir(dp)) != NULL) { puts(entry->d_name); }} Newer Introduction Older ExtendGDBviaPy