何らかの理由で、私はchar型にscanf_sから書き込むことができません。私はVisual Studio 2013で使用しています。 "%c"と "%c" scanf_s。迷っています。受信アドレスとサイズ、1です:文字タイプが入力されていない
// Alphabetic Pyramid Program - The Egyptians must have used C!
#include <stdio.h>
int main(void)
{
char ch;
printf("Enter the letter that will be the foundations of your Aphabetic Pyramid:\n"); // User is promted to enter a letter
scanf_s(" %c", &ch); // User inputs Foundational_letter
printf("The code for %c is %d!\n", ch, ch);
getchar();
getchar();
return 0;
}
ようこそスタックオーバーフロー。 [The Tour](http://stackoverflow.com/tour)を読み、[ヘルプセンター](http://stackoverflow.com/help/asking)の資料を参考にしてください。ここに聞いてください。 –
覚えておいてください:CとC++は同じ言語ではありません。タグ1のみ。 'scanf_s("%c "、&ch、1);' –
"scan_fからch char型に書き込めません。より具体的にしてください。エラーはありますか?間違った動作がある場合は、入力、予想結果、実際の結果を入力してください。 – kaylum