After I declare the key1 structure, I can't set it's member *dptr. I have been working on this since yesterday 
testdataunit.c:
Makefile:

testdataunit.c:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char *dptr;
int dsize;
} datum;
int main(int argc, char* argv[]) {
char keychar = 'b';
datum key1;
printf("debug: char set in key1\n");
char cpystring[] = "hey this is my string";
key1.dptr = cpystring; // this causes the crash!!!
printf("debug: cpystring allocated\n");
exit(0);
}
Makefile:
Code:
testdataunit : testdataunit.c
gcc -o testdataunit testdataunit.