Re: obj function hello()



On Fri, 09 Feb 2007 14:43:45 +1300, Ian Collins wrote:
Ian Collins wrote:
int main(void) {
Obj* obj = malloc( sizeof obj );

Oops, malloc( sizeof *obj );

Why malloc? Why a memory leak?

Best regards,
Roland Pibinger
.



Relevant Pages

  • Re: obj function hello()
    ... Obj* obj = malloc(sizeof obj); ... what else would you use to allocate memory than one of the ...
    (comp.lang.c)
  • Re: problem with output of the program on different OS
    ... obj = &o; ... taken care of. ... an error message "malloc has failed!: Insufficient memory" ...
    (comp.lang.c)
  • Re: Memory leak in ruby code
    ... a method that cleared the reference. ... No different to a memory leak in a non-garbage collected language. ... static data member or in a dynamic data member (instance ... obj could be reclaimed after doSomeWork(assuming the stack ref is the ...
    (comp.lang.ruby)
  • Re: TSQL for Table info
    ... but receiving the error as ... the obj does not exist in database whereas this is the table in my DB ...
    (microsoft.public.sqlserver.server)
  • Re: Problem with contains() method in ArrayList
    ... public boolean equals(Object obj) ... Regards ... Prev by Date: ...
    (comp.lang.java.programmer)