-6

我在 Pelles C 上创建了一个程序,但是,当我运行它时,它会直接跳到函数的末尾,只是说“按任意键继续”

#include <stdio.h>

int main()
{
    char letter;
    int num1, num2;

    printf("Enter any one keyboard character ");
    scanf("%c", &letter);
    printf("Enter 2 integers seperated by a space ");
    scanf("%d %d", &num1, &num2);

    printf("Numbers inputted were %d and %d \n" num1, num2);
    printf("letter input %c", letter);
    printf(" Stored at: %p \n", &letter);

    return 0;
}

谁能告诉我为什么会这样?

4

1 回答 1

1
printf("Numbers inputted were %d and %d \n" num1, num2);
                                           ^

您在上述声明中错过了,之前的内容。num1printf

printf("Numbers inputted were %d and %d \n",num1, num2);
于 2015-07-13T16:59:58.113 回答