{
printf("Please give a random positive number for X: \n");
scanf_s("%i", &X);
char ch = getchar();
char Gender;
if (isdigit)
{
printf("Hay um... sorry what my i call you?");
scanf_s("%i", Gender);
printf("%lf \n" Gender ", if you may, please reread what i said, i asked you to give me a RANDOM NUMBER. \ncan you please explain to me why you gave me out of 1 through infinite numbers, a random letter? \n \n ");
};
我的问题是[“%lf \ n”性别]说它期望[]]有人可以解释我在做什么错吗?
答案 0 :(得分:1)
这里有几个问题:
scanf_s
指向您要存储读取值的指针,因此它应为scanf_s("%i", &Gender);
char
插入字符串中。我不确定您要从中获得什么,因为%lf
是打印char
的一种很奇怪的格式,但这就是我所假设的。在这种情况下,您需要将Gender
移至末尾:printf("%lf \n...letter? \n \n", Gender);
。这会将Gender
插入%lf
的位置。