Thread: different data types

  1. #16
    Registered User
    Join Date
    May 2006
    Posts
    18
    Well, it doesn't run for very long. I tried adding a
    Code:
     for(;;)
    into it, but then it aborted for some reason.
    Last edited by elliptic; 06-05-2006 at 07:52 PM.

  2. #17
    Awesomefaceradcore bivhitscar's Avatar
    Join Date
    Apr 2006
    Location
    Melbourne, Australia
    Posts
    210
    Faq to the rescue: http://faq.cprogramming.com/cgi-bin/...&id=1043284385

    [EDIT]
    Though, I'd make it pause before the calls to free().
    Last edited by bivhitscar; 06-05-2006 at 08:04 PM.
    it's ironic considerate rarity patron of love higher knowledge engulfs me...

  3. #18
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > I'm on Win2k, running cygwin.
    Code:
    $ ulimit -a
    core file size          (blocks, -c) unlimited
    data seg size           (kbytes, -d) unlimited
    file size               (blocks, -f) unlimited
    open files                      (-n) 256
    pipe size            (512 bytes, -p) 8
    stack size              (kbytes, -s) 2042
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 63
    virtual memory          (kbytes, -v) 2097152
    Mine is limited to 2MB of stack space.


    > Red = create(w*h*sizeof(uint32));
    Code:
    uint32 **create ( uint32 w, uint32 h ) {
      uint32 i;
      uint32 **result = malloc ( h * sizeof *result );
      for ( i = 0 ; i < h ; i++ ) result[i] = malloc ( w * sizeof *result[i] );
      return result;
    }
    Add NULL checks as appropriate.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extending basic data types.
    By nempo in forum C++ Programming
    Replies: 23
    Last Post: 09-25-2007, 03:28 PM
  2. Replies: 4
    Last Post: 06-14-2005, 05:45 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. Using enumerated data types
    By SXO in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2001, 06:26 PM