Last active
February 4, 2019 15:23
-
-
Save KeitetsuWorks/dd77d3d4693e978f5a35026bb4ec1093 to your computer and use it in GitHub Desktop.
サンプルプログラム
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @file q14202983259.c | |
| * @brief サンプルプログラム | |
| * @author Keitetsu | |
| * @date 2019/02/04 | |
| * @copyright Copyright (c) 2019 Keitetsu | |
| * @par License | |
| * This software is released under the MIT License. | |
| */ | |
| #include <stdio.h> | |
| int main(void) | |
| { | |
| /* | |
| * * 配列a[]に以下の7つの整数を代入し, | |
| * 先頭アドレスから1Byteずつ取り出し | |
| * 文字型(%c)として出力するプログラムを作りなさい | |
| * * 176849379, 179476199, 176980707, 177776614, | |
| * 178749923, 177701347, 178225635 | |
| * * この配列はポインタを用いたものではなく,配列として取り扱うこと | |
| * (メモリ空間上にデータが並んでいる) | |
| */ | |
| int a[] = { | |
| 176849379, | |
| 179476199, | |
| 176980707, | |
| 177776614, | |
| 178749923, | |
| 177701347, | |
| 178225635 | |
| }; | |
| size_t a_size; | |
| int i; | |
| a_size = sizeof(a); | |
| for (i = 0; i < a_size; i++) { | |
| printf("%c", ((char *)a)[i]); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment