ztring.c: A few important extension for <string.h>
 All Classes Files Functions Variables Enumerator Friends Macros
Classes | Macros | Functions
zchz.h File Reference

Surrounded memory block used to detect unbounded string copies. More...

#include <iostream>
#include <climits>
#include <cstring>

Go to the source code of this file.

Classes

class  zchz
 Contains a memory block of 'SIZE' characters in between 3 memory blocks of that same 'zchz::SIZE'. More...
 

Macros

#define zchz_h
 Avoid multiple inclusion. More...
 

Functions

int rand (long &seed)
 Used 'seed' to generate the next random number. More...
 
ptrdiff_t operator- (char *l, zchz &r)
 
ptrdiff_t operator- (zchz &l, char *r)
 
char * operator+ (zchz &l, int i)
 

Detailed Description

Surrounded memory block used to detect unbounded string copies.

This class is useful to check that no memory overruns occur in C programs. Even though this is a C++ class, it can be used to test C programs.

Author
Adolfo Di Mare adolf.nosp@m.o@di.nosp@m.-mare.nosp@m..com
Date
2014

Definition in file zchz.h.

Macro Definition Documentation

#define zchz_h

Avoid multiple inclusion.

Definition at line 14 of file zchz.h.

Function Documentation

int rand ( long &  seed)
inline

Used 'seed' to generate the next random number.

Definition at line 253 of file zchz.h.

ptrdiff_t operator- ( char *  l,
zchz r 
)
inline

Definition at line 204 of file zchz.h.

ptrdiff_t operator- ( zchz l,
char *  r 
)
inline

Definition at line 221 of file zchz.h.

char* operator+ ( zchz l,
int  i 
)
inline

Definition at line 236 of file zchz.h.