#include <stdio.h> int main( void ) { char *name[7] = { "Iizumi", "Kanto", "Kudo", "Sato", "Sugawara", "Matuda", "Wada" }; char **p; int i, j; p = name; for ( i = 0; i < 7; i++ ){ for ( j = 0; *( *( p+i ) + j ) != '\0'; j++ ); printf( "%2d : %s\n", j, *( p+i ) ); } return 0; }
#include <stdio.h> int main( void ) { char *name[7] = { "Iizumi", "Kanto", "Kudo", "Sato", "Sugawara", "Matuda", "Wada" }; char **p; int i, j; p = name; for ( i = 0; i < 7; i++ ){ for ( j = 0; *( *p+j ) != '\0'; j++ ); printf( "%2d : %s\n", j, *p ); ++p; } return 0; }
#include <stdio.h> #include <string.h> int main( void ) { char *name[7] = { "Iizumi", "Kanto", "Kudo", "Sato", "Sugawara", "Matuda", "Wada" }; char **p; int i; p = name; for ( i = 0; i < 7; i++ ) { printf( "%2d : %s\n", strlen( *p ), *p ); ++p; } return 0; }
▼戻る▼
「初心者のためのポイント学習C言語」 Copyright(c) 2000-2004 TOMOJI All Rights Reserved