⑴ c語言中,為什麼總是說我自定義函數的調用的參數太少
你定義了幾個參數就要使用幾個參數
例如
定義
void
dingyi(char
aaa,char
bbb)
使用時如果只是這樣
dingyi(0x11);
就會提示
錯誤
因為少了一個參數
⑵ c語言 double C,F=fun();//這個括弧這顯示調用中的參數太少。為什麼,求指教。
因為你聲明的fun 需要傳一個參數。開發工具都會有檢查機制,如果不傳就會報錯
⑶ C語言initgraph()參數太少
兄弟,這個只能在c++上用,c不行,文件後綴名改了就行
⑷ C語言 fgets 參數太少菜鳥求解答
/*ex02-05.c*/
#include<stdio.h>
#include<string.h>
intmain(void){
charbuffer[256];
printf("Enteryournameandpress<Enter>: ");
fgets(buffer,256,stdin);
printf("Yournamehas%dcharactersandspaces! ",strlen(buffer)-1);
return0;
}
⑸ 有關c語言函數調用參數太少的小問題
strcpy_s包含在頭文件<string.h>中第一個參數:目標字元串指針第二個參數:字元串長度,可使用strlen()函數直接求出,切記,在使用strlen()求出字元串長度時,勿忘+1第三個參數:輸入字元串指針你缺少了一個參數⑹ c語言中函數調用XXXX時參數太少什麼意思
就是說主函數調用自定義函數時,傳遞的參數數量要一致。比如:
void fun()
{……}
main()
{
fun(); //調用的時候沒有參數,上面自定義函數fun後面的括弧里就沒有參數
}
再比如:
void fun(int a,int b)
{……}
main()
{
fun(3,4); //調用的時候有兩個參數,上面自定義函數fun後面的括弧里就用兩個參數來接收
}
⑺ C語言 錯誤提示「在函數XX中調用了太少的參數」
void outprint(struct list*head)
要傳一個list *型的參數給outprint啊,但你在main中調用時只寫了outprint(),沒傳參數,當然不行.
而且你的new()執行之後,返回值也沒傳給head.都沒建好list,你怎麼outprint
⑻ c語言中,為什麼總是說我自定義函數的調用的參數太少
首先要知道Dev-C++只是一個IDE。它並不自己實現編譯器,而是默認搭配MinGW版GCC編譯器。When C doesn't find a declaration, it assumes this implicit declaration: int f();, which means the function can receive whatever you give it, and returns an integer. If this happens to be close enough (and in case of printf, it is), then things can work. In some cases (e.g. the function actually returns a pointer, and pointers are larger than ints), it may cause real trouble。
GCC只是默認還允許implicit function declaration功能而已,較新的C規范(C99、C11)是不允許不聲明直接用的。