blob: 16cb70c8769767a2d2a86718d6ae1f4e170c1e75 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <gstring.h>
#include <iostream.h>
#include <fstream.h>
/**
* Append and prepend data to a string.
*/
int main(void)
{
gstring a;
gstring foo = "Hello";
gstring bar = "World!";
cout << "Variable is initialized to nothing: " << a << endl;
a.append(bar);
cout << "String is appended to variable: " << a << endl;
a.prepend(foo + " ");
cout << "String is prepended to variable: " << a << endl;
return 0;
}
|