Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCode Timing Question Pin
_Kal-El_2-Dec-02 11:00
_Kal-El_2-Dec-02 11:00 
GeneralRe: Code Timing Question Pin
Kannan Kalyanaraman2-Dec-02 20:24
Kannan Kalyanaraman2-Dec-02 20:24 
GeneralFILETIME conversion/comparison Pin
#realJSOP2-Dec-02 10:34
mve#realJSOP2-Dec-02 10:34 
GeneralRe: FILETIME conversion/comparison Pin
Nitron2-Dec-02 11:08
Nitron2-Dec-02 11:08 
GeneralRe: FILETIME conversion/comparison Pin
Jamie Hale2-Dec-02 11:33
Jamie Hale2-Dec-02 11:33 
GeneralRe: FILETIME conversion/comparison Pin
Michael Dunn2-Dec-02 12:15
sitebuilderMichael Dunn2-Dec-02 12:15 
GeneralQueue problem (part2) Pin
ian_ok2-Dec-02 10:24
ian_ok2-Dec-02 10:24 
GeneralRe: Queue problem (part2) Pin
Christian Graus2-Dec-02 10:55
protectorChristian Graus2-Dec-02 10:55 
Does your queue need to be a fixed size ? The other way to do it is a linked list, which is where you create a series of items that each contain the data you want, and a pointer to the next item, and possibly the previous also.


ian_ok wrote:
delete input; // Clean up

This does not work. To delete an array you need to do this:

delete [] input;

ian_ok wrote:
first=Array_Size;
last=0;


What are these for ? If you have an array, you can keep an index of how many items you have, and access items using either array notation ( input[pos] ), or pointer arithmetic ( *(input+pos) ).

I see you're using array notation.

ian_ok wrote:
first %= Array_Size; // Wrap the queue
return input[first++]; // Remove


I don't get this - how does this remove items from the queue ? That is, how does it reclaim the memory and make room in the queue ? If you want to use an array as your storage, you should use memcpy to move all the existing values down so there is room created at the end.



Christian

No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002

Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002

Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
GeneralResizing a CFormView class Pin
Georgi Atanasov2-Dec-02 10:12
Georgi Atanasov2-Dec-02 10:12 
GeneralRe: Resizing a CFormView class Pin
Maximilien2-Dec-02 10:50
Maximilien2-Dec-02 10:50 
GeneralWrite to parallel port Pin
Shay Harel2-Dec-02 10:03
Shay Harel2-Dec-02 10:03 
Generalhelp: right mouse click pop up menu Pin
trustno12-Dec-02 8:50
trustno12-Dec-02 8:50 
GeneralRe: help: right mouse click pop up menu Pin
valikac2-Dec-02 8:57
valikac2-Dec-02 8:57 
GeneralRe: help: right mouse click pop up menu Pin
Jason Henderson2-Dec-02 9:16
Jason Henderson2-Dec-02 9:16 
GeneralRe: help: right mouse click pop up menu Pin
Nitron2-Dec-02 10:00
Nitron2-Dec-02 10:00 
GeneralWizardsheet - propertypage and AfxMessageBox Pin
André Dewispelaere2-Dec-02 8:35
André Dewispelaere2-Dec-02 8:35 
GeneralCListCtrl + Report View + ... Problem Pin
mickelthepickle2-Dec-02 8:00
mickelthepickle2-Dec-02 8:00 
GeneralRe: CListCtrl + Report View + ... Problem Pin
pranavamhari2-Dec-02 14:44
pranavamhari2-Dec-02 14:44 
GeneralUDP and port 0 Pin
Dave_2-Dec-02 7:31
Dave_2-Dec-02 7:31 
GeneralRe: bind and port numbers Pin
Le centriste2-Dec-02 7:40
Le centriste2-Dec-02 7:40 
GeneralRe: bind and port numbers Pin
Dave_2-Dec-02 7:56
Dave_2-Dec-02 7:56 
GeneralRe: bind and port numbers Pin
Rickard Andersson202-Dec-02 8:04
Rickard Andersson202-Dec-02 8:04 
GeneralRe: bind and port numbers Pin
Dave_2-Dec-02 8:24
Dave_2-Dec-02 8:24 
GeneralRe: bind and port numbers Pin
Rickard Andersson202-Dec-02 8:34
Rickard Andersson202-Dec-02 8:34 
GeneralRe: bind and port numbers Pin
Dave_2-Dec-02 8:38
Dave_2-Dec-02 8:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.