because the input file is in binary format and it stores integer. I am reading in 4 bytes (size int) each time and store it in var c.
the code works for me when the file is less than 4GB
Type: Posts; User: franziss
because the input file is in binary format and it stores integer. I am reading in 4 bytes (size int) each time and store it in var c.
the code works for me when the file is less than 4GB
I tried createfile and readfile, it doesnt work for > 4gb files
Char c;
DWORD wmWritten;
HANDLE a =CreateFile(result_file.c_str(),...
Yes, the C and C++ IO libraries for your platform seems to choke on files larger than 4GB for 32 bit CPU because there is at most 2^32 memory address and > 4GB exceeded that.
I also tried...
Sorry, I don't really understand what you mean. I can use this code to open files or few hundred megabytes, this code is to count the number of lines in result_file, where each line is ended by a...
Standard c or c++ functions does not work for a file size of 13gb.
I use a simple code, and it can't even read the first line of the file. Each line in the input file is at most 100 characters
...
but what if the file is given by someone else and how do i cut them up into chunks?
i am reading up on the internet now, seems like java is able to do this. but is c++ able to do this in linux...
I got a 18 gigabytes dataset, and I try using
ipFile.open()
and
getline()
to read in the data, but it has problems, as I am using 32bit microsoft visual studio 2005, and 18gigabytes...
you are right! now I don't my pointers to null, but my program still works fine. I don't know where is the bug, but the program is still working
you are right, but i was thinking of saving time by not setting the pointers to NULL as I will definitely allocate memory to the pointers later. But nevermind, its better to be safe.
I solved my problem, I declared an array of pointers but I didn't initialize them to NULL. Then when I allocate memory to other arrays, somehow the uninitialized array of pointers is actually...
only here and Daniweb. Just curious, is there a competition between here and Daniweb? Like yahoo and google search engine?
oops... sorry guys, never knew there is this etiquette.
I think I will keep this post as a warning for others in future who commit the same mistake as me.
What does this error message mean? Thank you for your help
Heap corruption detected at 0072FB10
HEAP[algo.exe]: HEAP: Free Heap block 72fb08 modified at 72fb1c after it was freed
Windows has...
oh man, you are GOOD! you are spot on. I think I run out of file handles. Somewhere in my program, I didn't close another file pointer and all these file pointers accumulate.
Thanks alot Salem and...
What could be the reasons? Is it possible that there is memory corruption in my program? Or is it some applications is using result.txt?
I have a code
FILE *opfile = fopen("output.txt", "w");
and this code is in a function which is called more than hundred of times.
And sometimes opfile == NULL, which I think is...
ok, i understand, thanks guys!
I understand that using shifting bits to do multiplication is fast.
but what a mod? is using the standard mod fast? can i do shifting bits to do mod?
ok, thanks a lot for guiding me, i found an excellent article on this issue =)
http://www.codeproject.com/cpp/PtrToPtr.asp
ok, i get it, i do this right?
void cluster::function_B(int *&ptr_1, int *&ptr_2)
{
ptr_1 = ptr_2;
}
How do I make ptr_1 pointing to the same address of ptr_2 after function_B is called? I tried doing this, but after function_B exits, ptr_1 points back to NULL. Thanks!
void...
ok, thanks for your advice! =)
then what is the difference if i'm using bitset or char? or either way works?
ok, i understand what you guys are explaining, thanks! it's my mistake, thanks for your help! =)
i'm using microsoft visual studio 2005, yes, t1 points to the same bitset as t2, but &t1 != &t2
you are right in saying t1 is pointing to t2, but go and check &t1 and &t2,
they are of different memory allocation, this is the weakness of bitset. you can only point to t2 but what if you want to...