Thread: help on memory allocation(?)

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    3

    help on memory allocation(?)

    Hi everyone:
    I'm debuggering a package and have a problem, simply speaking, this package produces 2-D grids for image pixels and do some calculations, when I use 16*16 grids, everything is ok, but when I use 32*32 grids, in the output file some places have "*******"instead of numbers, when I use 64*64 grids, more "*******" found in output file.



    I think it is a kind of memory allocation problem, but I'm not sure, the trick is, if it is memory allocation problem, why the output file can produce some right numbers (for example, 32*32 grids, some numbers are correctly produced, even some numbers are incorrectly produced with "*******")? especially the correct numbers and incorrect "******" produced by same way...

    thank you

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    There are several things can could be wrong. It may have nothing to do with memory allocation at all.

    We can't really help you without seeing code though.
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by adameye View Post
    some places have "*******"instead of numbers
    Could it be formating problem? when number is bigger than the width modifier of printf?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    3
    you r absolutely right, I have figured out the problem by give numbers more space to display^_^, a small bug for that package, thank everybody here!

    Quote Originally Posted by vart View Post
    Could it be formating problem? when number is bigger than the width modifier of printf?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory allocation question
    By dakarn in forum C Programming
    Replies: 11
    Last Post: 12-01-2008, 11:41 PM
  2. Dynamic memory allocation.
    By HAssan in forum C Programming
    Replies: 3
    Last Post: 09-07-2006, 05:04 PM
  3. Dynamic memory allocation...
    By dicorr in forum C Programming
    Replies: 1
    Last Post: 06-24-2006, 03:59 AM
  4. C memory allocation to c++
    By markucd in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2005, 05:56 AM
  5. Understanding Memory Allocation
    By Ragsdale85 in forum C Programming
    Replies: 7
    Last Post: 10-31-2005, 08:36 AM