ive been hearing this word but what is malloc?

Recommended Answers

All 3 Replies

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.

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:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.