T
TBass
Hi,
I've been switching a C program over to C++, and using std::string for
all the string members of the class.
One question I'm having trouble finding documentation on is how to put
numeric varaible data into a string. For example, in the C program I
did the following:
sprintf( sql, "SELECT * FROM DEVICES WHERE RKEY=\'%d\'", device_id );
But, in C++, I'm trying to do something similar to the following:
std::string sql;
int device_id;
sql = "SELECT * FROM DEVICES WHERE RKEY = ' ".... ?? HOW DO I INSERT
THE VALUE OF device_id?
I'm trying to do things the proper "C++" way.
Thanks in advance,
T
I've been switching a C program over to C++, and using std::string for
all the string members of the class.
One question I'm having trouble finding documentation on is how to put
numeric varaible data into a string. For example, in the C program I
did the following:
sprintf( sql, "SELECT * FROM DEVICES WHERE RKEY=\'%d\'", device_id );
But, in C++, I'm trying to do something similar to the following:
std::string sql;
int device_id;
sql = "SELECT * FROM DEVICES WHERE RKEY = ' ".... ?? HOW DO I INSERT
THE VALUE OF device_id?
I'm trying to do things the proper "C++" way.
Thanks in advance,
T