アドレス計算
#include <stdio.h>
void main()
{
char* str = "hello";
int i;
for ( i=0; i<5; i++ ) {
putchar( *( str + i ) );
putchar( str[ i ] ); // 配列としての実体はない
}
}
http://gardener.hustle.ne.jp/programming/
C言語関連の要点まとめ(更新停止中)
#include <stdio.h>
void main()
{
char* str = "hello";
int i;
for ( i=0; i<5; i++ ) {
putchar( *( str + i ) );
putchar( str[ i ] ); // 配列としての実体はない
}
}
Trackback URL : http://gardener.hustle.ne.jp/programming/sb.cgi/30
Comments