Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::memory::New Macro
C++
#define New(type) ((type*)Allocate(sizeof(type)))
Parameters 
Description 
type 
type to allocate 

A simple macro to allocate a new single unit of a structure. Adds a typecast automatically to be (type*) so C++ compilation is clean. Does not burden the user with extra typecasts. This, being in definition use means that all other things that are typecast are potentially error prone. Memory is considered uninitialized.

int *p_int = New( int );
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!