
19.08.2009, 08:57
|
|
Участник форума
Регистрация: 19.05.2007
Сообщений: 281
С нами:
9989619
Репутация:
106
|
|
PHP код:
string& append ( const string& str );
Appends a copy of str.
string& append ( const string& str, size_t pos, size_t n );
Appends a copy of a substring of str. The substring is the portion of str that begins at the character position pos and takes up to n characters (it takes less than n if the end of string is reached before).
If the position passed is past the end of str, an out_of_range exception is thrown.
string& append ( const char * s, size_t n );
Appends a copy of the string formed by the first n characters in the array of characters pointed by s.
string& append ( const char * s );
Appends a copy of the string formed by the null-terminated character sequence (C string) pointed by s. The length of this character sequence is determined by the first ocurrence of a null character (as determined by traits.length(s)).
string& append ( size_t n, char c );
Appends a string formed by the repetition n times of character c.
Потому и нельзя
PHP код:
int n = 5;
string str = "test";
str.append((char *)n);
cout << str;
если только так и это уже будет не число. или так
PHP код:
int n = 5;
char f[5];
string str = "test";
itoa(n,f,10);
str.append(f);
cout << str;
Последний раз редактировалось St0nX; 19.08.2009 в 13:14..
|
|
|