Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Problem with a simple C app. Calloc

Name: shaun 2010-06-04 8:43

I'm making this simple C program.  I'm using Calloc to allocate space to hold an array containing the number of instances of each letter in the file.
Source: http://pastebin.com/G46Pr6Tg

When I try to Calloc, or Malloc then memset the memory, one of the items in the array is not initialised to zero.  This is part of the array straight after initialisation:
......
Number of f: 0
Number of g: 0
Number of h: 134777
Number of i: 0
Number of j: 0
......

What did I do wrong?

Name: Anonymous 2010-06-04 14:14

>>14
Thank you, using the anonymous thingy flag right (im on winblows right now)?
And i also dont know how to check i my current program break is at the end of the page, should i be using a ASM instruction or is there a better way.

I may sound like a total noob for asking, but the page address is just a 16 bit addr stored in the xs registers, right?

I feel kind of bad for asking, i had some troubles with my function and troubles finding (understandable) information on x86 memory handling.

If anybody knows some good and somewhat short articles/tuts on x86 internals please give me a link.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List