Showing posts with label strrev. Show all posts
Showing posts with label strrev. Show all posts

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);