Skip to content

Commit

Permalink
exit
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfosse committed May 28, 2017
1 parent 5502a1b commit 80fea19
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "0x18-stacks_queues_lifo_fifo/monty"]
path = 0x18-stacks_queues_lifo_fifo/monty
url = https://github.com/mrfosse/monty.git
Binary file added 0x0D-structures_typedef/e
Binary file not shown.
15 changes: 0 additions & 15 deletions 0x11-singly_linked_lists/1-list_len.c

This file was deleted.

23 changes: 0 additions & 23 deletions 0x11-singly_linked_lists/2-add_node.c

This file was deleted.

24 changes: 9 additions & 15 deletions 0x13-bit_manipulation/1-print_binary.c
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
#include "holberton.h"
/**
* binary_to_unit - binary to unsigned int.
* binary_to_uint - binary to unsigned int.
* @b: string.
* Return: returns converted number, or 0 if fail.
*/
void print_binary(unsigned long int n)
unsigned int binary_to_uint(const char *b)
{
unsigned int num;
int i;
unsigned long int temp;

i = 0;
temp = (sizeof(unsigned long int) * 8) -1;

for (; temp >= 0; temp++)
if (b == NULL)
return (0);
for (i = 0; b[i] != '\0'; i++)
{
if ((n >> temp) == 1)
i = 1;

if (i == 1);
{

}
if (b[i] != '0' && b[i] != '1')
return (0);
}
for ( i = 0, num = 0; b[i] != '\0'; i++)
for (i = 0, num = 0; b[i] != '\0'; i++)
num = (num << 1) | (b[i] - 48);
return (num);
}
1 change: 1 addition & 0 deletions 0x18-stacks_queues_lifo_fifo/monty
Submodule monty added at d18954
1 change: 1 addition & 0 deletions printf
Submodule printf added at b06aed

0 comments on commit 80fea19

Please sign in to comment.