This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| void itob(int n, char s[], int b) | |
| { | |
| int i = 0, temp; | |
| n = n > 0 ? n : -n; | |
| do { | |
| temp = n % b; | |
| if(temp < 10) | |
| s[i++] = '0' + temp; |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.IO; | |
| namespace remraw | |
| { | |
| class Program | |
| { |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| long unsigned int strToInt(char * str) | |
| { | |
| long unsigned int result = 0; | |
| while(*str) | |
| { | |
| result *= 10; | |
| result += *str - '0'; | |
| str++; | |
| } | |
| return result; |
| #include <stdio.h> | |
| int * shuffle(int * array, int seed, int index, int len); | |
| int * unshuffle(int * array, int seed, int index, int len); | |
| void swap(int * num1, int * num2); | |
| void printArray(int * array, int len); | |
| int main() | |
| { | |
| int vec[5] = {1, 2, 3, 4, 5}; |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #define Shuffle(A, B, C) shuffle(A, B, 0, C, sizeof(*A)) | |
| #define Unshuffle(A, B, C) unshuffle(A, B, 0, C, sizeof(*A)) | |
| typedef struct | |
| { | |
| int x; |
| #include <stdio.h> | |
| void hello(int i); | |
| int main(int argc, char * argv[]) | |
| { | |
| hello(5); | |
| } | |
| void hello(int i) |
| #include "..\Header\stack.h" | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| void stackinit(Stack * stack) | |
| { | |
| stack->top = NULL; | |
| stack->top->next = NULL; | |
| stack->isempty = true; |
| #include "stack.h" | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| #include <assert.h> | |
| void stackpush(Stack ** stack, int value) | |
| { | |
| assert(stack != NULL); |
| #include "..\Header\stack.h" | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdbool.h> | |
| #include <assert.h> | |
| void stackpush(Stack * stack, int value) | |
| { | |
| assert(stack != NULL); | |
| if(stack->top == NULL) |