Error in MSDN Example
-
i was just reading the MSDN-Library on Events for Thread-Synchronization and stumbled across the following code:
#define NUMTHREADS 4
//...
HANDLE hReadEvents[NUMTHREADS] // ...
DWORD i // ...
for(i = 1; i <= NUMTHREADS; i++)
{
hReadEvents[i] = CreateEvent( // ...i mean - does anyone check these examples? obviously this code accesses memory beyond the array-boundaries: hReadEvents[4] in the last loop. :wtf: see here: Using Event Objects it's in the first code example or am i missing something? :confused: :wq
-
i was just reading the MSDN-Library on Events for Thread-Synchronization and stumbled across the following code:
#define NUMTHREADS 4
//...
HANDLE hReadEvents[NUMTHREADS] // ...
DWORD i // ...
for(i = 1; i <= NUMTHREADS; i++)
{
hReadEvents[i] = CreateEvent( // ...i mean - does anyone check these examples? obviously this code accesses memory beyond the array-boundaries: hReadEvents[4] in the last loop. :wtf: see here: Using Event Objects it's in the first code example or am i missing something? :confused: :wq
Heh, that's pretty funny. Use the "What did you think of this topic?" link at the bottom of the page to report the error. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy
-
Heh, that's pretty funny. Use the "What did you think of this topic?" link at the bottom of the page to report the error. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas." -- Buffy
-
i was just reading the MSDN-Library on Events for Thread-Synchronization and stumbled across the following code:
#define NUMTHREADS 4
//...
HANDLE hReadEvents[NUMTHREADS] // ...
DWORD i // ...
for(i = 1; i <= NUMTHREADS; i++)
{
hReadEvents[i] = CreateEvent( // ...i mean - does anyone check these examples? obviously this code accesses memory beyond the array-boundaries: hReadEvents[4] in the last loop. :wtf: see here: Using Event Objects it's in the first code example or am i missing something? :confused: :wq
It looks like a VB-programmer has been messing with C++ .. :-D -- Seraphim Shock. Gold for your ears.