4
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by yuzhang
0

Ever heard of google?...
Ever bothered to read threads on the same page with malloc in the title?

Ever been a Newbie yourself? :mrgreen:
Come on- try to be a little less abrupt next time. We'd like new members to feel welcomed here, not belittled.

0

ive been hearing this word but what is malloc?

Hi there:

malloc is for "memory allocation". While programming, we very often need to allocate free memory for variables of unknown length, which can not be decided at the time of programming. E.g. a program prompts people's names; since each person's name is different, the programmer is unlikely to allocate a fixed amount of memory to hold their names. (You may argue that it is possible to assign a whole bunch of memory; it is a bad practise and it is problem prone. )
A similar function is calloc().

A very good book to learn C language is C programming, A modern approach by K.N.King.

Does that answer your question?:cheesy:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.