string::append related question

Hi,
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
using namespace std;
int main()
{
	string a("aeiou");
	string b;
	char c;
	c = a.at(2);
	b +=c;
	//b.append(c ......);
	cout << b << endl;
	return 0;
}


How could i complete line 10 in order to do the samething that line 9 does?
Thanks
ahh ... i get it...
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
using namespace std;
int main()
{
	string a("aeiou");
	string b;
	char c;
	c = a.at(2);
	//b +=c;
	b.append(1, c);
	cout << b << endl;
	return 0;
}


I was missing this:
string& append ( size_t n, char c );
Topic archived. No new replies allowed.