University of Virginia Department of
    Computer Science

Purify: Examples

Sample "Hello, World" from the Purify Manual

'#include <stdio.h>
'#include <malloc.h>
static char *helloWorld = "Hello, World";
int main()
{
	char *myString = malloc( strlen(helloWorld) );
	strncpy(myString, helloWorld, 12);
	printf("%s\n", myString);
}

Compile with Purify

% purify cc hello_world.c

Results and Explanation


HelpNet
HelpNet was created by the 1997 incoming graduate class. It is only occasionally updated.