小编Pra*_*khi的帖子

函数和参数给出错误

下面这个代码的结果应该是30,但是在编译和运行时,这给了我以下结果

the result of 2358968 and 0 is 4200271, a , b , result
Run Code Online (Sandbox Code Playgroud)

我不明白,当我没有那个值的变量时,结果怎么样?

#include<stdio.h>
#include<conio.h>

void add( int , int );   

int main(){
    add(10,20);
    getch();
    return 0 ;
}


void add(int a, int b){
    int result = a + b;
    printf("the result of the %d and %d is %d, a, b, result");  
}
Run Code Online (Sandbox Code Playgroud)

c printf

0
推荐指数
1
解决办法
78
查看次数

标签 统计

c ×1

printf ×1