News for hackers. Stuff that matters.
Re:Guide to Advanced Programming in C by greenyoda on Thursday February 06, 2014 @05:39PM (#7193396)
I'm not sure how malloc/free could be considered "advanced" C programming techniques. It's pretty hard to write any non-trivial program in C without using malloc/free and knowing the differences between static, stack-allocated and heap-allocated memory.
Re:Guide to Advanced Programming in C by adultSwim on Thursday February 06, 2014 @05:51PM (#7193452)
You'd be surprised with how far you can get without dynamic memory or recursion...

Still, I agree with your general sentiment. That some of these are "advanced" topics is troubling. Too many programmers today don't know how a computer works. Our ideas of "mastery" are way too low.

Re:Guide to Advanced Programming in C by erobbins on Thursday February 06, 2014 @08:28PM (#7194265)
in the modern climate of bootcamped rails hackers, knowing that memory even needs to be allocated at some point is advanced.
Re:Guide to Advanced Programming in C by pfacka on Thursday February 06, 2014 @05:47PM (#7193427)
The challenging part is to get details of using them correctly and avoid security and portability issues and I consider it neccesaty introduction for section dealing with memory management.
Re:Guide to Advanced Programming in C by spc476 on Friday February 07, 2014 @03:46AM (#7195357)
And he didn't get all the details right.

    realloc(valid_pointer,0);
IS defined (in C89 no less) to act like free(). It is NOT operating system dependent.
Re:Guide to Advanced Programming in C by pfacka on Friday February 07, 2014 @04:24AM (#7195470)
True, but return type of free() is void, thus it says nothing about return value. The POSIX says: "If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned."
Re:Guide to Advanced Programming in C by Iftheshoefits on Thursday February 06, 2014 @07:02PM (#7193809)
Depends on one's reference point. A lot of people in the web development world (for example) would probably consider manual memory management to be an advanced topic, because typically they've "grown up" with languages where memory management was so removed or abstracted as to be almost irrelevant beyond trivial "do I have enough RAM to hold this array?" type concerns.
Re:Guide to Advanced Programming in C by dinkumthinkum on Thursday February 06, 2014 @07:33PM (#7193964)
Well honestly then they are sort of beginners to computer programming. Using malloc is not advanced C programming.