Search
 
SCRIPT & CODE EXAMPLE
 

CPP

int to string Using boost::lexical_cast

#include <iostream>
#include <boost/lexical_cast.hpp>
using namespace std;

int main() {
  // a variable of int data type
  int num = 05;
  // a variable of str data type
  string str; 

  // using boost::lexical_cast<string> to convert an int into a string
  str = boost::lexical_cast<string>(num);

  cout << "The integer value is " << num << endl;  
  cout << "The string representation of the integer is " << str << endl;  
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: Use of Scope Resolution operator for namespace 
Cpp :: c++ trim string 
Cpp :: sort vector in c 
Cpp :: error c4001 
Cpp :: Data Encapsulation in C++ 
Cpp :: Temporary file using MSFT API in cpp 
Cpp :: gcc compile multi thread 
Cpp :: the statement vector vector int matrix(100 vector int (50 100) ) declares 
Cpp :: c++ cout update percentage 
Cpp :: GoPro camera for kids aus 
Cpp :: ue4 set size of widget c++ 
Cpp :: access the element of vector point2f c++ 
Cpp :: online compiler c++ with big O calculatorhttps://www.codegrepper.com/code-examples/cpp/how+to+convert+string+to+wchar_t+in+c%2B%2B 
Cpp :: find maximum contiguous Sub arrays 
Cpp :: clean list widget qt 
Cpp :: different way to print string in c++ 
Cpp :: declare static table filled cpp 
Cpp :: why does the pointer value doesn;t change when I change it in funciton 
Cpp :: compilling c++ and c by console 
Cpp :: unreal ensureMsgf example 
Cpp :: time out search element in linked list c++ 
Cpp :: c++ switch integer 
Cpp :: c++ union set q5 
Cpp :: cast c++ 
Cpp :: gcd of two number in c++ stl 
Cpp :: c++ compile to msi 
Cpp :: min stack 
Cpp :: main function 
Cpp :: cpp tutorial 
Cpp :: pre increment vs post increment c++ 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =