Skip to content
Snippets Groups Projects
Commit 904fa8a3 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Added compilation of StringExample.

parent c49c5d49
No related branches found
No related tags found
1 merge request!15Nina
......@@ -17,3 +17,7 @@ add_subdirectory( flow-vl )
#add_subdirectory( hamilton-jacobi-parallel-map )
#add_subdirectory( fast-sweeping-map )
#add_subdirectory( narrow-band )
ADD_EXECUTABLE( StringExample StringExample.cpp )
target_link_libraries( StringExample tnl )
\ No newline at end of file
#include <iostream>
#include <TNL/String.h>
using namespace TNL
using namespace TNL;
using namespace std;
int main()
int main( int argc, char* argv[] )
{
// constructors
String str1;
......@@ -16,23 +18,24 @@ int main()
cout << "str4:" << str4 << endl;
// functions
int size = str3.getSize();
/*int size = str3.getSize();
cout << "size of string:" << size << "bytes" << endl;
int alloc_size = str3.getAllocatedSize();
cout << "alloc_size:" << alloc_size << endl;
int memory = str1.setSize( 256 );
cout << "memory:" << memory << endl;
str1.setSize( 256 );
size = str3.getSize();
cout << "size of string:" << size << "bytes" << endl;*/
String str
setter = str.setString( "Something new" );
cout << "setter:" << setter << endl;
int getter = str4.getString();
const char* getter = str4.getString();
cout << "getter:" << getter << endl;
String word( computer ) ;
String word( "computer" ) ;
third_letter = word[2];
cout << "third_letter:" << third_letter << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment