アドレス計算


#include <stdio.h>
void main()
{
 char* str = "hello";
 int i;

 for ( i=0; i<5; i++ ) {
  putchar( *( str + i ) );
  putchar( str[ i ] ); // 配列としての実体はない
 }
}

C > ポインタ | comments (0) | trackbacks (0)

Comments

Comment Form

icons:

Trackbacks