简单数据类型转换

string ltos(long l)  
{  
    ostringstream os;  
    os<>result;  
    return result;  
  
}  
long stol(string str) 
{  
    long result;  
    istringstream is(str);  
    is >> result;  
    return result;  
}

//改一下函数名,变量类型,搞定

你可能感兴趣的:(简单数据类型转换)