|
////////////////////////////////////////////////////////////////////////////////
// $Id: main.c,v 1.4 2005/03/31 02:10:54 db Exp $
//
// A simple C example program for testing the Visual Leak Detector.
//
////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Include Visual Leak Detector
#include <vld.h>
int main (int argc, char *argv [])
{
char *s = (char*)malloc(14);
strncpy(s, "Hello World!\n", 14);
printf(s);
//free(s);
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
In real life I'm a firmware engineer. I mostly do C and assembly programming on obscure proprietary hardware. But I started my programming career doing a lot of C++. So, occassionally in my free time I enjoy dabbling in my own Windows programming projects with Visual C++ to keep my C++ skills from rotting away completely.
I also like to keep abreast of the GNU/Linux scene because, well let's face it, Windows isn't everything. I've recently found Cygwin to be a good way of getting the best of both worlds.