20130503

How to reverse a string using pointer or array in cpp without using strrev library function

How to reverse a string using pointer or array. CPP program for reversing a strings without using inbuilt library function strrev. How to reverse a sentence in cpp/C++/C without using library function strrev.Program to reverse a string using pointer.
#include<stdio.h>
#include<string.h>
int main()
{
char arr1[20];
printf("Enter a String:\n");
scanf("%s",&arr1);
printf("You entered:%s\n",arr1);

20130428

CPP program for concatenating two strings without using inbuilt library function strcat


How to concatenate two strings using pointer or array. CPP program for concatenating two strings without using inbuilt library function strcat. How to concatenate two strings in cpp/C++/C without using inbuilt in function strcat.Program to concatenate two strings using pointer.

#include<stdio.h>
#include<string.h>
int main()
{
char arr1[20];
printf("Enter a String:\n");
scanf("%s",&arr1);

20130426

How to search a substring in C++/Cpp without using library function strstr


/*How to search a sub string without using library function strstr. 
How to use pointer/array to search substring in a string sentence.
C++/CPP/C program/code to search a word in a sentence without using inbuilt function strstr*/
#include<stdio.h>
#include<string.h>
int main()
{
char arr1[50];
printf("Enter a String:\n");
scanf("%s",&arr1);

char arr2[20];
printf("Enter a String:\n");
scanf("%s",&arr2);
printf("Searching for:%s\n",arr2);

20130425

How to use make file in CPP C+++ C

/*What is makefile  ?
---------------------------------------
makefile is a script/utility  that contains target, dependencies and actions to compile modified file/files in a project of multple files.  */

/*SYNTAX
-----------------------------------
target:dependencies
[tab]  actions
.
.

20130422

How to implement msgq message queue in CPP C C++


//Program to implement msgq
/*CPP Program for msg queue in Linux
pipes work with related process parent-child only.
Fifo can make unrelated process to communicate but
fifo created does not persists for use in future.
Shared memory is similar to fifo but over comes this and can be used later also.
Program to implement IPC Message Queues IPC mechanism.
msgqSendkirk.c adds the message on the message queue.
msgqRecvSpock.c reads and removes the message from the message
queue.To use this program first compile and run msgqSendkirk.c
to add a message to the message queue. To see the
Message Queue in other terminal run msgqRecvSpock.c
ipcs -q shows the msg ques.
ipcrm -q 131073 removes the msgq created say 131071 */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
//1. declaring the msg structure
struct my_msgbuf
{