Home » U++ Library support » U++ Core » How to read file into Memory
Re: How to read file into Memory [message #12129 is a reply to message #12124] |
Fri, 12 October 2007 08:08   |
spidertp
Messages: 16 Registered: October 2007 Location: Poland
|
Promising Member |
|
|
Thank you Mirek for your answer.
Quote: | Well, I would use Buffer:
Buffer<object> table1(10*1024*1024);
|
I read Container Tutorial but not "Overview of U++ containers - NTL" and I was not aware of Buffer container.
Quote: | BTW, are you aware that the allocation will most likely be sizeof(object) * 10MB (not only 10MB, if sizeof(object) > 1)?
|
Well, I'm dividing 10MB by sizeof(object) and then creating table with number of objects which can fit inside.
Quote: | Well, using new / delete is not wise, anyway it should work, what problems exactly do you have?
|
I think I had problems with delete operator because I used and not operator.
I had exceptions in FreeDebug function.
Thank you or your help and keep doing good work on UPP!
Best regards
Tomasz
Ah, I have one more question about debugging - how can I see specific object in a table or vector?
For example:
struct MyStruct
{
float table[100];
String text;
}
main
{
...
MyStruct myTable[100];
Vector<MyStruct> myVector[100];
myVector[99].table[1] = 15.5;
...
}
In debugging mode, in Explorer I write:
and he says
Only writing myVector is OK, but how can I see specific item in it? Only LOG or DUMP?
|
|
|
Goto Forum:
Current Time: Sat Aug 02 07:14:09 CEST 2025
Total time taken to generate the page: 0.12731 seconds
|