All pastes #217954 Raw Edit

Unnamed

public text v1 · immutable
#217954 ·published 2006-10-23 22:30 UTC
rendered paste body
#include <stdio.h>

int stringlength(char string[]);

int main() {
    char string[] = "test test test\0";
    char *cur, *dest;

    dest = string;
    cur  = NULL;

    int count = 0;
    while ( *dest != '\0' ) {
        while ( *dest != 0x20 ) {
            dest++;
            // net zolang string doorlopen totdat die ene spatie gevonden heeft
            cur = dest;
        }

        while ( *cur == 0x20 ) {
            printf("test\n");
            cur++;
        }

        dest++; 
    }

    printf("spaties: %d\n", count);
    printf("%s\n", string);
    return 0;
}