devc++错题_数组定义

2021/11/22 14:09:55

本文主要是介绍devc++错题_数组定义,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

  1. (double)int a /int b=【double型】

但是为了防止数据溢出,最好将a、b类型改成double型

或者改成4/5.0=

2.

  [Error] declaration of 'a' as multidimensional array must have bounds for all dimensions except the first"没有定义数组长度”————扩展:数组声明定义时,行可以省,列不可以省,eg:int a[][100]

        二维数组传参数:int fun(int a[][100],int n)

int main()

{

int ch=fun(a,n)

}

给列向量一个长度。

而给一维数组传参因该是:

int fun(int a[],int n)

int main()

{

int ch=fun(a,n)

}



这篇关于devc++错题_数组定义的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程