Skip to content

Instantly share code, notes, and snippets.

@erenon
erenon / probaNZH_f3.c
Created October 28, 2010 20:09
probaNZH f3
#include <stdio.h>
#include <stdlib.h>
int *evszamok(char k[], int *meret) {
int i=0, j=0, state=0, evszam = 0, m=0, cm=0;
int *evszamok = NULL, *evszamok2 = NULL;
while(k[i]){
switch(state){
case 1: //1 jegy?
@erenon
erenon / pggyak-kzh-1.c
Created November 8, 2010 22:11
pggyak kzh 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *filter(char *source, char *haystack) {
int i,j;
int nlen, cur, filter_flag;
char *nstr;
nlen = 0;
@erenon
erenon / pggyak-kzh-2.c
Created November 8, 2010 22:12
pggyak-kzh-2.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *trim(char *str) {
int i=0, spbefore=0, slen=0, spafter=0;
char *newstr;
slen = strlen(str);
@erenon
erenon / book.c
Created November 23, 2010 08:39
book list
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _book {
char author[50];
int page;
int is_sentinel;
struct _book *next;
@erenon
erenon / listn.c
Created November 23, 2010 09:41
insert after n
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _list {
int value;
struct _list *next;
} list;
@erenon
erenon / mutantbtree.c
Created November 29, 2010 20:30
mutant and balanced binary tree
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _btree {
int value;
struct _btree *left;
struct _btree *right;
} btree;
@erenon
erenon / mod.c
Created December 5, 2010 23:05 — forked from anonymous/mod.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX_STRING_LENGTH 101
typedef struct {
char szerzo[101];
char cim[101];
unsigned kev;
char tema[101] ;
@erenon
erenon / Makefile
Created December 6, 2010 19:24
Makefile
C_SRCS += \
./library.c \
./functions.c \
./konyvtar.c
OBJS += \
./library.o \
./functions.o \
./konyvtar.o
@erenon
erenon / digit check.sh
Created December 9, 2010 12:31
Checks the digit resoult
#!/bin/bash
wget http://home.mit.bme.hu/~laczko/digit_eredmenyek.pdf -N -q
if [ -e "digit_md5" ]; then
md5sum digit_md5 --status -c
if [ $? != 0 ]; then
echo "===FRISSÜLT==="
fi
else
@erenon
erenon / find_memleak.h
Created May 6, 2011 17:42
find_memleak
#include <iostream>
#include <cstdlib>
#define new _NEW_WRAPPER() + new
using namespace std;
int _NEW_WRAPPER() {
cout << "hello" << endl;
return 0;