For an array based implementation, wouldn't it just be "delete[] myarray", or would it be more complicated?
Is it necessary to delete each individual element in the queue or does that just suffice?
Could someone give me an example if it is?
For an array based implementation, wouldn't it just be "delete[] myarray", or would it be more complicated?
Is it necessary to delete each individual element in the queue or does that just suffice?
Could someone give me an example if it is?
The easiest thing to do is just hold an std::vector or std::array inside your queue, which one depending if the max queue size is known compile time or runtime. No destructor needed in that case.
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.
It does not depend on a kind of collection (queue or array); it only depends on a lifetime of items. If the item is pointer and the queue owns items, then you should delete each individual item. You could use any smart pointer to automate the deletion of items, e.g. share_ptr.
You'd think that after a week of waiting, the guy would have said something if he'd wanted more input or a thread bumped.
How to ask smart questions
Code:DWORD dwBytesOverwritten; BYTE rgucOverWrite[] = {0xe9,0,0,0,0}; WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);