Skip to content
A python script for your C code properly.
Branch: master
Clone or download
Pull request Compare This branch is 1 commit ahead of rahulkumaran:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
img
.gitignore
LICENSE.md
README.md
index.html

README.md

Code-Cleaner

It is often observed that beginners don't indent their code properly.
For example:

int main()
{
int a=0,b=0;
while(++a<5)
{
++b;
}
printf("%d %d",a,b);
}

As you can see above, the code hasn't been indented rightly, and as a result it becomes tough to comprehend the code.
For this reason, this code cleaner script will take your un indented C program and then give out your C program that is indented.

int main()
{
  int a=0,b=0;
  while(++a<5)
  {
    ++b;
  }
  printf("%d %d",a,b);
}

After indentation the code is supposed to look like the above version.

The main code has been written in Python and is in the apps folder. There's also a test code written in C(test.c)

Currently this program can indent files and execute them directly for you!

Before running the program, make sure that you've compiled your program and give the name of the executable(or .o file) when asked to do so.
Run the program by going into the app directory after cloning and then type:

    python3 main.py

This will run the program and ask you for typing in the name of the file which you want to indent properly. You can type test.c to check whether the code runs or not!

You can’t perform that action at this time.