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?

(その2).構造体で遊ぶ。(中身を見る)

Posted at

x M5NanoC6での予定は、未定

目的
強制キャストして中身を見て遊ぶ

いろいろ
むずかしい、書き方をすると
渋谷の交差点にいる「ネコと和解せよ」?の人?になるので
簡素な書き方をする?(なに言ってんだかわからない!!!)
(ここは、東京近郊です。(毎日、渋谷は、花火大会か、お祭りの様に混んでいる(あたりまえ)))

オンラインコンパイラ


#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    printf("START\n");
    
    struct {
        char a = 'A';
        char b = 'B';
        char c = 'C';
    } ABC;
    
    char *c;
    c = (char *)(&ABC);

    printf("a=[%c]\n",c[0]);
    printf("b=[%c]\n",c[1]);
    printf("c=[%c]\n",c[2]);
    
}//main




START
a=[A]
b=[B]
c=[C]


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?