pointer_arithmetic2.c 287 字节
Newer Older
B
Ben 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
/* Compile with:
export CFLAGS="-g -Wall -std=gnu11 -O3"  #the usual.
make pointer_arithmetic2
*/
#include <stdio.h>
typedef char* string;

int main(){
    string list[] = {"first", "second", "third", NULL};
    for (string *p=list; *p != NULL; p++){
        printf("%s\n", *p);
    }
}