[memo][C言語]printf
C言語printf関数のメモです。
$ vi printf.c
--------------------------------------
#include <stdio.h>
int main(){
printf("Hello World\n");
int int_a = 10;
printf("int_a = %d\n", int_a);
float float_b = 10.1;
printf("float_b = %f\n", float_b);
char char_a = 'a';
printf("char_a = %c\n", char_a);
char char_b[20] = "おはよう。";
char char_c[20] = "こんにちは";
printf("%s%s\n", char_b, char_c);
return 0;
}
--------------------------------------
$ gcc printf.c -o printf_c
$ ./printf_c
Hello World
int_a = 10
float_b = 10.100000
char_a = a
おはよう。こんにちは