Skip to content

Instantly share code, notes, and snippets.

View branan's full-sized avatar
💩

Branan Riley branan

💩
View GitHub Profile
@branan
branan / readfile
Created November 28, 2012 20:11 — forked from Lunanne/readfile
Hashing code, stupid homework
FILE * fp = fopen("woorden.txt","rb");
char tempBuffer[35];
while(fgets(tempBuffer,sizeof(tempBuffer),fp)!=NULL)
{
//we found a word.Let's assume its shorter than 35 characters and we can safe some space
int length = strlen(tempBuffer);
word = malloc(length*sizeof(char));
strncpy(word,tempBuffer,length);