mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-23 03:53:53 +00:00
31 lines
594 B
C++
31 lines
594 B
C++
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
#include <assert.h>
|
||
|
|
||
|
#include "../slice_array.h"
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
SString s, t;
|
||
|
s = SString("hello");
|
||
|
cout << s.toString() << ", len=" << s.length << endl;
|
||
|
cout << (s=="hel") << (s=="hell") << (s=="hello") << endl;
|
||
|
t = s;
|
||
|
|
||
|
s = SString("othello"+2, 4);
|
||
|
cout << s.toString() << ", len=" << s.length << endl;
|
||
|
cout << (s=="hel") << (s=="hell") << (s=="hello") << endl;
|
||
|
|
||
|
cout << (s==t) << (SString("hello")==t) << endl;
|
||
|
|
||
|
const int arr[4] = {1,2,3,4};
|
||
|
|
||
|
IntArray ia(arr,4);
|
||
|
|
||
|
cout << ia.length << " " << ia.ptr[2] << endl;
|
||
|
|
||
|
return 0;
|
||
|
}
|