【发布时间】:2020-06-29 17:00:47
【问题描述】:
下面的程序应该读取一个双精度数 x 和一个 int 数并在屏幕上输出它们的值。 readin 函数 () 用于读取。我用 (.......) 标记了程序中存在问题的缺失点。我添加了我如何尝试它的 cmets,但它仍然没有工作。谁能帮帮我
#include <stdio.h>
void readin(double*, int*);
int main(void) {
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
double x;
int n;
readin(.......); //readin(&x, &n);
printf("\nd are %6.2lf", x);
printf("\nn are %6i", n);
return 0;
}
void readin(double* x, int* n) {
printf("\nEnter a double value for x: ");
scanf(.....); //scanf("%f", &n);
printf("\nEnter an int value for n: ");
scanf(.....); //scanf("%f", &x);
}
【问题讨论】:
标签: c pointers pass-by-reference