C language > Windows questions

malloc and 64 bit ?

(1/3) > >>

bitcoin:
Hello
If i use malloc in 64 bit program, this allocates memory in address,start in FFFFF...
and program don't work.
why?

John Z:
Hi bitcoin,

Well I searched and searched but couldn't find the error code for "doesn't work"  :)
Seriously though you are not giving enough information to allow any help to be useful.

It seems you received no error message when using the malloc, but are saying something else
did not work and you seem to be suspecting/pointing to the memory address.  Other than
that what didn't work is unspecified.  You mention 64 bit specifically, have you tried 32 bit and
does it work as you wanted?

Can you zip and post a small project that demonstrates what doesn't work?

John Z

bitcoin:
Hello, John Z
See attach

John Z:
Thanks bitcoin,

Well other than two missing h files I don't see, or get, any error.  I ran both the std exe and the debug exe, no error.
Attached is the debug 'Local' tab, and a memory view of the x pointer.  BTW I set changed memset to 1 so it
is easy to see the memset results in memory.  The x location was also shown in debug by mouse hover over x
also attached screen shot and it matches the local display. The memory at the location was filled with 1s.

I'm at a loss to see a problem.

John Z

TimoVJL:
In windows 7 x64 i got address 0000000000610068h

Navigation

[0] Message Index

[#] Next page

Go to full version