General Discussions

Dynamic Memory Allocation API’s – Quick Glance

malloc – allocates and reserves a block of memory, specified in bytes and returns a pointer to the first byte of allocated space. Example: malloc(size) char *str; str = (char *)malloc(10); calloc – allocates multiple block of same size, initializes all locations to zero and returns a pointer to the first byte of allocated space… Continue reading Dynamic Memory Allocation API’s – Quick Glance

General Discussions

Static V/S Dynamic Memory Allocation

  Si. No Static Memory Allocation Dynamic Memory Allocation 1 Memory allocation happens at compile time Memory allocation happens at Run time 2 It applies to global variables, file scope variables, and variables qualified with static defined inside functions It applies to variables that allocate memory during runtime using memory allocation API’s 3 The size is… Continue reading Static V/S Dynamic Memory Allocation

General Discussions

Should one Learn Functional Programming?

Originally posted on PH Bytes:
Functional originates from mathematics. Languages are about expressing the statements of a program in a formal way. The languages stress on the evaluation and using the resulting value. They will get you some strong foundation on computer science programming concepts. I say that one must and should enjoy learning functional…

General Discussions

Interesting ways to learn Programing

Originally posted on PH Bytes:
So the idea is to accumulate like a cumulative frequency. Put down the roots of programming and branch out with every new language while the trunk remains the same and strong! So, you have three parts. Root, Branches and Trunk. For the Roots part, I would suggest you to read…

General Discussions

malloc( ) in C

Originally posted on PH Bytes:
Function malloc() is used to dynamically allocate the memory in C. The general syntax goes the following way: (type_casting) malloc (size) let us understand it in detail in the form of a conversation: That’s how the components of the syntax: “(type casting the pointer) malloc(specifying the size) “ can be…