Code:
Well, I am not a student rather an old programmer trying to refresh my C language. I actually have the following but it crashes when I ran it.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
struct _TEST
{
char msg[250];
int cnt;
}TEST;
typedef struct _TEST **PTR;
int main(int argc, char *argv[])
{
PTR ptr;
// allocate memory
if((ptr = (struct _TEST **) malloc(sizeof(struct _TEST))) == NULL)
return -1;
// assign values to the struct members
strcpy((*ptr)->msg, "This is what you think!");
(*ptr)->cnt = 2011;
// print the values
printf("%s %d\n", (*ptr)->msg, (*ptr)->cnt);
// free the memory
free(ptr);
return 0;
}