Sample code for 30+ languages & platforms
C++

Load StringTable from a StringBuilder

Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.

Chilkat C++ Downloads

C++
#include <CkStringTable.h>
#include <CkStringBuilder.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkStringTable strTab;
    CkStringBuilder sb;

    sb.Append("This is line 1\r\n");
    sb.Append("An empty line follows...\r\n");
    sb.Append("\r\n");
    sb.Append("This is line 4\r\n");

    strTab.AppendFromSb(sb);

    int i = 0;
    int numStrings = strTab.get_Count();
    while (i < numStrings) {
        std::cout << i << ": " << strTab.stringAt(i) << "\r\n";
        i = i + 1;
    }
    }