Categories

Subscribe via Email

Enter your email address to subscribe and receive notifications of new content by email.

C++ programming video

Another terrific video, this time for C++

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInWhatsAppBibSonomyDeliciousDiggDiigoSina WeiboWordPressBlogger PostShare

Java programming

A video about programming in Java

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInWhatsAppBibSonomyDeliciousDiggDiigoSina WeiboWordPressBlogger PostShare

Standard C Memory Management

This section will cover memory management elements from the Standard C Library.

Note:
It is recommended to use the new and delete operators instead of these functions, as they provide additional control over the creation of objects.

calloc

Syntax
#include <cstdlib>
void *calloc( size_t num, size_t size);

The function calloc() allocates a block of memory that can store num objects of size size. In addition, the block of memory allocated is set to all zeros.

If the operation fails, calloc() returns NULL.

free

Syntax
#include <cstdlib>
void free( void *p);

The function free() releases a previously allocated block from a call to calloc, malloc, or realloc.

malloc

Syntax
#include <cstdlib>
void *malloc( size_t s );

The function malloc() allocates a block of memory of size s. The memory remains uninitialized.

If the operation fails, malloc() returns NULL.

realloc

Syntax
#include <cstdlib>
void *realloc( void *p, size_t s);

The function realloc() resizes a block created by malloc() or calloc(), and returns a pointer to the new memory region.

If the resize operation fails, realloc() returns NULL and leaves the old memory region intact.

Note:
realloc() does not have a corresponding operator in C++ – however, this is not required since the standard template library already provides the necessary memory management for most usages.
FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInWhatsAppBibSonomyDeliciousDiggDiigoSina WeiboWordPressBlogger PostShare

Python Programming

A video to help you with Python Programming

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInWhatsAppBibSonomyDeliciousDiggDiigoSina WeiboWordPressBlogger PostShare