Showing posts with label conversion of array into string. Show all posts
Showing posts with label conversion of array into string. Show all posts

Friday, 30 January 2015

Array of Char to String Conversion in C++

Structure of the Problem Requirements

  This Program convert an array of char into string in C++ program. The most simple way to convert an array of char into String is that just assign the value of array to string and it will be converted into string.

Source Code

#include<iostream>
using namespace std;
int main ()
{
cout<<"\t \t \t LEP Tutorials \n \n \n ";
char LEP [200] = " This is Array of Char \n ";
string s ;
s = LEP;
cout<<s<<endl;
}

Output of the Program

Array of Char to String Conversion in C++