>>15,17
Javafag detected
This is the way things work in C, dickbag.
>>1
It will work depending on your compiler implementation. Every C compiler that I know of manages the heap by address. So free() doesn't care what variable name you pass to it, only what address it points to.
>>24
Oops, I meant to refer to >>21, no >>1. >>1 is broken because you are trying to free a pointer to a stack variable, which >>21 fixed.
Name:
Anonymous2011-01-19 16:23
>>24 Javafag detected
This is the way things work in C, dickbag.
What the hell is this bullshit in my/prog/.
In C you don't cast void* away, it's C++ that bitches about it.
Also, (.+)fag detected
Go back to the imageboards. IHSBT
>>29
I'm running Ubuntu 9.10, so I don't think so Tim.
Name:
Anonymous2011-01-19 20:24
>>30
Once a process has ended, the kernel frees all the memory it allocated for it and that includes heap memory. Now go learn about memory management before making random assertions about the operating system you've been using for two weeks.
>>41
In C, it's redundant, because void* can be implicitly casted to any type. It's like an Any, an Object, an object. It's sepples that sucks so much that even the ``Any'' type must be casted.
>>43
In C, the only thing you need to know is:
You need to cast void* only when you have to dereference it.
You don't dereference void*.
When you need to dereference void*, you assign the pointer to another pointer with the correct type instead of working on the casted void*.
>>44
That's a special case in C, instated due to the frequent need to pass around untyped memory addresses.
That is not the case in high-level languages, and there is no direct parallel. In particular, the object base class is normally not implicitly convertible to any class.
C++ tossed it due to delusions of high-levelness, to discourage C-style code and interfaces.
there is no memory leak OP. a and b points to the same memory. once you free one of them that memory location is unallocated and both pointers are invalid.
Protip: What do you think free looks like?
It already takes a copy of the pointer in the argument passed it, so of course you can assign pointers back and forth between how many variables you want.
>>87
(imply (>implying (compiler-sizeof 'char) is #\1) being true and do (>implying displayln gets applied to "EPIC WIN OP!" and (current-output-port)) otherwise (>implying displayln gets applied to "Fuck off, >>87"))
`>imply COMBINATOR
Name:
Anonymous2011-01-23 22:06
>>81
I'm sorry Windows isn't standards-conforming.
Look at the bright side, at least you aren't using GNU. :)