psemianonymous
Programmer
I have a problem. The following line produces the error "First-chance exception in lt.exe (NTDLL.DLL): 0xC0000005: Access Violation." when I'm in debug mode.
The code is:
The relevant output (if this helps you) is:
[tt]sizeof sizeof parseTableRow_t * MAX_REASONABLE_PARSE_TABLE_ROWS
16 82 1312
[/tt]
Now. If I change my constant MAX_REASONABLE_PARSE_TABLE_ROWS to something small, like "10", then this code works. But the above failed, as well as my original code, which had the "MAX" constant set to 400. Is this a size issue? Am I not allowed to allocate large chunks of memory?
By the way, table is a pointer to the "parseTableRow_t" struct. I'm using MSVC6.
Pete
The code is:
Code:
cout << "sizeof sizeof parseTableRow_t * MAX_REASONABLE_PARSE_TABLE_ROWS" << endl;
cout << sizeof parseTableRow_t << " " << MAX_REASONABLE_PARSE_TABLE_ROWS << " " << sizeof parseTableRow_t * MAX_REASONABLE_PARSE_TABLE_ROWS << endl;
//table = (parseTableRow_t *)malloc(sizeof parseTableRow_t * MAX_REASONABLE_PARSE_TABLE_ROWS);
[red]table = new parseTableRow_t[MAX_REASONABLE_PARSE_TABLE_ROWS];[/red]
The relevant output (if this helps you) is:
[tt]sizeof sizeof parseTableRow_t * MAX_REASONABLE_PARSE_TABLE_ROWS
16 82 1312
[/tt]
Now. If I change my constant MAX_REASONABLE_PARSE_TABLE_ROWS to something small, like "10", then this code works. But the above failed, as well as my original code, which had the "MAX" constant set to 400. Is this a size issue? Am I not allowed to allocate large chunks of memory?
By the way, table is a pointer to the "parseTableRow_t" struct. I'm using MSVC6.
Pete