TurboC returns malloc() NULL

This is a discussion on TurboC returns malloc() NULL within the C++ Programming forums, part of the General Programming Boards category; When I try to call malloc() or farmalloc() from a program I compiled in TurboC, it always returns NULL. What's ...

  1. #1
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,534

    TurboC returns malloc() NULL

    When I try to call malloc() or farmalloc() from a program I compiled in TurboC, it always returns NULL. What's the deal here?

    It's not like I don't have room in my memory for 5 bytes.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Can you post a minimal code snippet that demonstrates the issue? It may also behoove you to mention OS.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    This is the third post from you about DOS programming and extremely old compilers. Why are you doing this? Turbo C is extremely outdated.

  4. #4
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,534
    Ah, nevermind I have it working now. I have no idea what I did to make it work, but it just is.

    @Bubba, I was trying to make somthing for an old computer, but I've given up on it now, my idea was bad, so I don't care to share.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,344
    > I have no idea what I did to make it work, but it just is.
    Your re-arrangement of the deck chairs has temporarily stopped the titanic from sinking.

    In other words, the problem is still there, but through random tinkering, you've managed to cover up the problem for the moment.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,534
    >> In other words, the problem is still there, but through random tinkering, you've managed to cover up the problem for the moment.

    Most likely the case.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List Not Saving Value as Int
    By bar338 in forum C Programming
    Replies: 4
    Last Post: 05-04-2009, 07:53 PM
  2. addrinfo Structure Not Working
    By pobri19 in forum Networking/Device Communication
    Replies: 9
    Last Post: 10-22-2008, 10:07 AM
  3. Problem with a menu.
    By Rare177 in forum Windows Programming
    Replies: 4
    Last Post: 09-07-2004, 11:51 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  5. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 06:48 PM

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