Ch Standard Demos
ISO C90 Standard
Wide characters
ISO C99 Standard
C++ features
Complex IEEE floating-point arithmetic
Assumed-shape arrays
Nested functions
Interactive C statement execution
Interactive command shell
Shell Programming
Safe Ch
Ch applets
String Type
Adjustable array bounds
Auto array bound checking
Socket/Winsock
POSIX
Unix utilities for Windows
Windows
GTK+
X/Motif
OpenGL
Toolkits Demos
CGI
ODBC
ChExcel
Ch Professional Demos
Computational array
Plotting
Numerical analysis
C LAPACK functions
This is the first example.


#include <stdio.h>
#include <string.h>

int main () {
    string_t s, token;
    s = stradd("abcd ", "1234 ", "ABCD");
    printf("s = %s\n", s);
    foreach (token;s) {
        printf("token = %s\n", token);
    }
}
The output is:
s = abcd 1234 ABCD
token = abcd
token = 1234
token = ABCD

Here is the second example:

#include <iostream> #include <string.h> using namespace std; int main(){ string_t word; char c; word="then"; printf("word = %s\n", word); cout<<word<<endl; strputc(word, 3, 'a'); cout<<word<<endl; c = strgetc(word, 0); printf("c = %c\n", c); c = strgetc(word, 1); printf("c = %c\n", c); return 0; } The output is:
word = then
then
thea
c = t
c = h