"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "tutorial/SimpleSample/main.cc" of archive wipeout-tut-1.5.4.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 #include "Stringlist.h"
    2 #include <iostream.h>
    3 #include <unistd.h>
    4 
    5 main() {
    6    Stringlist sl;                                // create a new stringlist
    7    String s1("hello");                           // create a string
    8    String s2(" WipeOut");
    9    s1.add(s2);                                   // add a second part of string
   10    cout << "count: " << sl.count() << endl;      // print the number of strings in the list
   11    sl.add(&s1);                                  // add the string to stringlist
   12    cout << "count: " << sl.count() << endl;      // print the number of strings in the list once again
   13    cout << "message: " << sl[0]->data() << endl; // print the first string
   14    sleep(3);
   15 }