1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

M5NanoC6の変数型のサイズを計って遊ぶ。(知っていると思うけど)

Last updated at Posted at 2025-01-25

x 過去ログを見ょ!!!
x 「シリアルモニタ」は、なんどか開き直す
x 3.1.1

目的
主な型のサイズを見る
sizeof関数を使って遊ぶ

結果

o_coq784.jpg

プログラム



void setup() {
  // put your setup code here, to run once:

  //シリアルの初期化
  Serial.begin(9600);
  Serial.println("");
  //シリアルの待ちが0.5*9
  for (int i = 0; i < 9; i++) {
    delay(500);  //接続待ち
    Serial.print(".");
  }  //for
  Serial.println("");

  Serial.printf("char -> (%d)\n",sizeof(char));
  Serial.printf("unsigned char -> (%d)\n",sizeof(unsigned char));
  Serial.printf("char * -> (%d)\n",sizeof(char *));
  Serial.printf("int -> (%d)\n",sizeof(int));
  Serial.printf("long -> (%d)\n",sizeof(long));
  Serial.printf("long long -> (%d)\n",sizeof(long long));
  Serial.printf("float -> (%d)\n",sizeof(float));
  Serial.printf("double -> (%d)\n",sizeof(double));
  Serial.println("");
}

void loop() {
  // put your main code here, to run repeatedly:

}



1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?