Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 998 Bytes

File metadata and controls

47 lines (36 loc) · 998 Bytes

#TODO

See

use this in Ros client/server translators for string <--> Point:

#include <iostream>
#include <string>
#include <iomanip>
#include <sstream>

using namespace std;

int main()
{
    float num1 = 1234.5678912345;
    float num2 = 9876.54321;
    ostringstream ss;
    
    ss << setprecision(10) << num1;
    string tmpStr1;
    tmpStr1 = ss.str();

    ss.str(string() );
    ss << setprecision(10) << num2;
    string tmpStr2;
    tmpStr2 = ss.str();
    
    string str = tmpStr1;
    str.append("|");
    str.append(tmpStr2);
   
    cout << "tmpStr1: " << tmpStr1 << endl;
    cout << "tmpStr2: " << tmpStr2 << endl;
    cout << "str: " << str << endl;
    //cout << sizeof(str) << endl;

    return 0;
}