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.
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.
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.*
This is the third post from you about DOS programming and extremely old compilers. Why are you doing this? Turbo C is extremely outdated.
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.
> 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.
>> 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.