scanf调用中类型的操作数无效

scanf调用中类型的操作数无效,c,C,我在编译下面的程序时遇到了这个错误,我不知道为什么 39:19:错误:“const char[5]”和“long long int”类型的操作数对二进制“operator&”无效 这是密码 int main(void) { long long d, p; // Ask for number for the numbers of days as long as input is between 28 and 31 do { printf("

我在编译下面的程序时遇到了这个错误,我不知道为什么

39:19:错误:“const char[5]”和“long long int”类型的操作数对二进制“operator&”无效
这是密码

int
main(void)
{
    long long d, p; 

    // Ask for number for the numbers of  days as long as input is between 28 and 31
    do  
    {
       printf("How many days are in your month?\n");
       scanf("%lld" &d);    // This is the line with the error
    }   
    while (d<28 || d>31);

    // Ask user for number of pennies for day 1 as long as input is not negative
    printf("How many Pennies do you have?\n");
    do
    {
        scanf("%lld", &p);    
    }
    while (p<0);

    //sum up the pennies
    int i;
    for (int i=0; i<=d-1; i++);
    {
        p = (p * 2);
    }

    // Format and print the total  (currently * instead of / for troube-shooting)
    double total;
    total = (p * 100);
    printf("Your ending amount it $%.2f.\n, total");        
}
int
主(空)
{
长d,p;
//只要输入值在28到31之间,就可以询问天数
做
{
printf(“您一个月有多少天?\n”);
scanf(“%lld”&d);//这是出现错误的行
}   
而d31;
//只要输入不是负数,就要求用户提供第1天的便士数
printf(“您有多少便士?\n”);
做
{
scanf(“%lld”、&p);
}

而(p您在
scanf(“%lld”&d);
中忘记了一个逗号。这导致它将参数解释为
scanf
,原因是某些字符与数字进行了位合并

将其更改为:

scanf("%lld", &d);

您在
scanf(“%lld”&d);
中忘记了一个逗号。这导致它将参数解释为
scanf
,因为某些字符以数字为位

将其更改为:

scanf("%lld", &d);
应该是

scanf("%lld", &d); //not scanf("%lld" &d);
应该是

scanf("%lld", &d); //not scanf("%lld" &d);

@CalebLawrence,这是真的。我必须承认我记不起曾经漏掉一个逗号,但我昨天确实漏掉了一个点来访问一个成员。@CalebLawrence,这是真的。我必须承认我记不起曾经漏掉一个逗号,但我昨天确实漏掉了一个点来访问一个成员。我认为如果你你纠正问题中的错误。答案似乎毫无意义。我认为如果你纠正问题中的错误,将来读者会感到非常困惑。答案似乎毫无意义。@CalebLawrence不是问题。下面是我如何解决这些问题的方法。我开始注释问题,直到代码编译。分而治之r、 @CalebLawrence不是问题。下面是我解决此类问题的方法。我开始注释,直到代码编译。分而治之。