Created
February 10, 2020 04:56
-
-
Save sukesan1984/18fd5e8d4ea2d7c249ce047b3f18fe00 to your computer and use it in GitHub Desktop.
This file contains 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
#include <unistd.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
char hoge[7] = "abcdef"; | |
// 以下の表記はすべて同じ。 | |
//char hoge[] = "abcdef"; | |
//char hoge[7] = {'a', 'b', 'c', 'd', 'e', 'f', '\0'}; | |
//char hoge[] = {'a', 'b', 'c', 'd', 'e', 'f', '\0'}; | |
write(1, &hoge, 6); | |
write(1, "\n", 6); | |
fprintf(stdout, "on memory:\n"); | |
fprintf(stdout, "| %c | %c | %c | %c | %c | %c | %d |\n", hoge[0], hoge[1], hoge[2], hoge[3], hoge[4], hoge[5], hoge[6]); | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment