help on memory allocation(?)

This is a discussion on help on memory allocation(?) within the C Programming forums, part of the General Programming Boards category; Hi everyone: I'm debuggering a package and have a problem, simply speaking, this package produces 2-D grids for image pixels ...

  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,246
    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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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, 06:04 PM
  3. Dynamic memory allocation...
    By dicorr in forum C Programming
    Replies: 1
    Last Post: 06-24-2006, 04: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21