Last active
December 18, 2016 13:48
-
-
Save 8q/1046c2a9477cb1c09689add821f6d53e 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
#define _CRT_SECURE_NO_WARNINGS | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) { | |
int a = 0; | |
char *s = (char *)malloc(sizeof(char) * 100); | |
printf("aのアドレス::%x\n", &a); | |
printf("sのアドレス::%x\n", s); | |
printf("aの値を入力してください:"); | |
scanf("%d", &a); | |
printf("sの文字列を入力してください:"); | |
scanf("%s", s); | |
printf("入力待機中、Enterを押してください\n"); | |
getchar(); //ここでscanfのEnterを流す。 | |
getchar(); //Enter待機 | |
printf("a:%d\n", a); | |
printf("s:%s", s); | |
getchar(); //表示してすぐ終了しないように | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment