//***************************************************************************
// File name: simple.c
// Author: Chadd Williams
// Date: 1/31/2011
// Class: CS480
// Assignment: Eclipse Example
// Purpose: This is a simple C file that can be used to demonstrate how to
// use Eclipse, Subversion, Debugger, Valgrind, and Makefiles.
// The code below has been seeded with memory errors to
// demonstrate the use of Valgrind.
//***************************************************************************
#include <stdio.h>
#include <stdlib.h>
void printer(char * str)
{
printf("%s", str);
}
int main(int argc, char** argv)
{
char *pLetter;
pLetter = (char*) malloc(sizeof(char));
printer("HELLO WORLD");
printer("\n");
printer("GOODBYE WORLD");
printer("\n");
*pLetter = 'P';
printf("%c\n",*pLetter);
free(pLetter);
printf("%c",*pLetter);
pLetter = (char*) malloc(sizeof(char));
pLetter = (char*) malloc(sizeof(char));
return 0;
}