Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
boaromayo authored Apr 13, 2018
1 parent 29cfa1e commit 6c96887
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions c-cpp/bintodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <string.h>
#include <stdlib.h>

int bin_to_dec(char* bin)
int bin_to_dec(char * bin)
{
int binlen = strlen(bin);

Expand All @@ -13,11 +13,10 @@ int bin_to_dec(char* bin)
dec += (1 << (binlen - i) - 1);
}
}

return (int)dec;
}

int main(int argv, char** argc)
int main(int argv, const char ** argc)
{
char * bin = (char*)malloc(8); // Allocate bits.

Expand Down

0 comments on commit 6c96887

Please sign in to comment.