Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
tux:typecasting [2011/11/30 20:01] wikisysop [Explizite Typumwandlung] |
tux:typecasting [2011/11/30 20:02] (aktuell) wikisysop [Explizite Typumwandlung] |
||
---|---|---|---|
Zeile 44: | Zeile 44: | ||
int_pointer = int_array; | int_pointer = int_array; | ||
- | for(i=0; i < 5; i++) { // iterate through the int array with the int_pointer | + | for(i=0; i < 5; i++) { |
- | printf("[integer pointer] points to %p, which contains the integer %d\n", | + | printf("[integer pointer] points to %p, which contains the integer %d\n", int_pointer, *int_pointer); |
- | int_pointer, *int_pointer); | + | |
int_pointer = int_pointer + 1; | int_pointer = int_pointer + 1; | ||
} | } | ||
- | for(i=0; i < 5; i++) { // iterate through the char array with the char_pointer | + | for(i=0; i < 5; i++) { |
- | printf("[char pointer] points to %p, which contains the char '%c'\n", | + | printf("[char pointer] points to %p, which contains the char '%c'\n", char_pointer, *char_pointer); |
- | char_pointer, *char_pointer); | + | |
char_pointer = char_pointer + 1; | char_pointer = char_pointer + 1; | ||
} | } |