Help for this page

Select Code to Download


  1. or download this
    char string[] = "Hello";
    char *ptr;
    fr ( ptr = string; *ptr; ptr++ ) {
        do_something_with( *ptr ); // This is a single char
    }
    
  2. or download this
    foreach my $char ( split //, $string ) { ... }
    while ( $string =~ /(.)/g ) { my $char = $1; ... }
    for ( my $i = 0; $i <= length $string; $i++ ) { my $char = substr( $st
    +ring, $index, 1 ); ... }