Don't be afraid, I am from the Internet, ma'am! ;-)

Code:
typedef struct mytruct // struct definition
{
  int example;
};
void foo()
{
  mystruct ms = NULL;                // variable definition
  ms = malloc(sizeof(mystruct));     // allocate memory.
  memset(ms,0,sizeof(mystruct));     // initialize memory.
  ms->example = 1337;                // use the struct
  free(ms);                          // free the memory allocated
  ms = NULL;                         // signalize the pointer has become invalid.
}


And for the dynamic array ...

Code:
void bar()
{
  int* a = NULL;                   // define array as a pointer to an int.
  a = malloc(sizeof(int) * 23);    // Allocate memory for 23 elements of int
  a[12] = 1337;                    // Use the array for whatever you want.
  free(a);                         // free the allocated memory.
  a = NULL;                        // invalidate the pointer.
}




Always learn from history, to be sure you make the same mistakes again...