Code Snippet: string split in c++ (c syntax)

Below code snippet useful while splitting string (char*) .   #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> int split (const char *str, char c, char ***arr) { int count = 1; int token_len = 1; int i = 0; char *p; char *t; p = str; while (*p != '\0') { if (*p == … Continue reading Code Snippet: string split in c++ (c syntax)

Advertisements

Process Synchronization (Part 1)

We can divide processes in two Categories 1) Co-operative Processes 2) Independent Processes Co-operative processes are those where the execution of one process affects or affected by other process and if they are not dependent than they are independent processes. In this tutorial we will study :- 1) problems 2) Conditions to achieve synchronization 3) … Continue reading Process Synchronization (Part 1)

Creating linked list Dynamically ( Dynamic Memory Allocation) part – 1

We have seen representation of linear data structures by using sequential allocation method of storage ,as in arrays. But sometimes linear memory allocation is unacceptable in a program ,this can be due to various reason like  Unpredictable storage requirements for the program and can be due to extensive data manipulation takes .To satisfy these requirements … Continue reading Creating linked list Dynamically ( Dynamic Memory Allocation) part – 1