1 2 3 4
int max = rand(); // or any init value int min = rand(); // or any init value int tmp = rand(); // or any init value ...
C How to find max, min of thr...
by Tien Dung,
November 18, 2008 12:33,
4 refactorings
1 2 3 4
#include <math.h> #include <stdio.h> #include <stdlib.h> ...
1 2 3 4
-(IBAction)countCharacters:(id)sender {
NSString *inputString = [[NSString alloc] initWithFormat:[input stringValue]];
...
C Counting characters
by halbtuerke,
October 21, 2008 17:16,
1 refactoring, tagged with count, character, objectivec, cocoa
This is actually Objective-...
1 2 3 4
char **split (char *string, char sep, char escape) { char **ret = NULL; ...
C A Java-like function split
This function splits a stri...
1 2 3
#include <math.h> #include <stdio.h> ...
C Fastest way to get value of pi
by Chris Jester-Young,
July 30, 2008 03:50,
3 refactorings, tagged with pi, speed, language agnostic
Solutions welcome in any la...
1 2 3 4
#include <stdio.h> #include <math.h> int main () ...
C Quanti bit per rappresentar...
Dato un intero,determinare ...
1 2 3 4
.section .text .globl _start _start: ...
C Il programma più piccolo in...
by Gnix,
February 19, 2008 22:46,
1 refactoring
Il programma più piccolo in...
1 2 3 4
#ifndef _LINKED_LIST_H_ #define _LINKED_LIST_H_ #include "common.h" ...
C Linked lists implementation
Hello, im not sure whether ...
1 2 3 4
int socket_read_line_alloc(int sock, char** out) { /* current buffer size */ unsigned int size = 128; ...
C Socket read line in C
I don't like the char** out...
1 2 3 4
#define kSpace 032 char buf[] = {0x42, 0x73, 0x75, 0x27, 0x13, 0x1C, 0x68, 0x1B, 0x64}; ...
C Character buffer manipulati...
by Mike,
October 14, 2007 02:17,
10 refactorings
Hi All,
I was given this...
1 2 3 4
/* Linked list that emulates a hash map */ # include <stdlib.h> # include <stdio.h> ...
C Misbehaving global pointer
by getopenid.com/ptn,
October 13, 2007 17:55,
2 refactorings
I was in the middle of this...
1 2 3 4
vector<Service*> services; .... .... ...
C pointor of vector problem
by guzi5618.myopenid.com,
October 09, 2007 12:46,
1 refactoring
Here is my code. I would li...
1 2 3 4
/* Transforms a number to a string * e.g 1234 => "1234" * ...
C simplest of mallocs examples
by getopenid.com/ptn,
October 02, 2007 20:24,
5 refactorings
Practising for my test tomo...
1 2 3 4
_=0;c(q){q<0?putchar("`',)( \n-\\_/"[q+11]):c(("#" "CB#_,ab:@BbBXb\\bG]N_2JNH4`X:.MRLA,aA(J`)BFRTBRL" "'####_SJ[0RJbb\\R]N=5,64XMMR976Hb\\QLARZ[O-TZ[RT" ...
C C simple loop
by Andy Sloane,
September 27, 2007 17:52,
15 refactorings
How to make this shorter ?
I tried to use as less vari...