RE: Glib::ustring conversion



Hello,

i use this method to convert int or double in a string so it should work for ustring ;)

string convertIntToString(int result)
{
	char buffer[100];
	sprintf(buffer, "%d", result);
	string str = buffer;
       return str;
}

and for string to int :

int stringToInt(string str)
{
	char buffer[100];
	int nb;
	strcpy(buffer, str.c_str());
	nb = atoi(buffer);
	return nb;
}

hope it can help you

_________________________________________________________________
Ne cherchez plus, trouvez ! Avec le nouveau MSN Search. http://search.msn.fr/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]