Also, you should not use new and if you use it, don't use it without a smart pointer like unique_ptr or shared_ptr.
And I have one more advice for your coding practices, even if this one is more of a question of good taste. Don't use DWORD or BYTE unless you really need to. Use cstdint's uint32_t or uint8_t instead.
Using a new without a smart pointer type is fine as long as you know what you are doing and you know who has ownership of the pointer, and DON'T forget to use delete on it, otherwise you might be better of using a smart pointer type. But just flat out saying don't use without a new is just wrong. In this case you don't even need to use "new" as "Byte buffer;" will achieve the same thing without dynamic memory
As for the types I would define my own typedefs like this
typedef uint8_t byte;
typedef uint16_t word;
typedef uint32_t dword;
typedef uint64_t qword;
typedef unsigned __int8 byte;
typedef unsigned __int16 word;
typedef unsigned __int32 dword;
typedef unsigned __int64 qword;
As GCC and MSVC approach this differently, but the typedefs can now be used on both and will mean the same on both platforms.
Edited by NightCreature83, 12 July 2012 - 02:22 AM.