首页 > 试题广场 >

在int p[][4]={{1},{3,2},{4,5,6}

[单选题]
int p[][4] = {{1}, {3, 2}, {4, 5, 6}, {0}};
中,p[1][2]的值是()
  • 1
  • 0
  • 6
  • 2
p[][4] = 
1 0 0 0
3 2 0 0
4 5 6 0
0 0 0 0

发表于 2015-10-17 12:13:32 回复(8)
原来是这样
发表于 2016-05-17 08:44:37 回复(0)
数组中没有写出来的部分默认值为0
发表于 2020-08-19 00:06:01 回复(0)
下标从0开始,没有初始化的元素默认初始值为0
编辑于 2023-04-04 17:01:33 回复(0)
int p[][4] = {{1}, {3, 2}, {4, 5, 6}, {0}};    p[1][2]    
1  0  0  0
3  2  0  0
4  5  6  0
0  0  0  0
发表于 2023-03-16 08:44:46 回复(0)
数组p[4][4],没有赋值的,默认为0.

发表于 2015-10-16 19:30:52 回复(0)
int类型数组默认值为0
发表于 2022-08-05 02:29:32 回复(0)
没有赋值的地方,默认为0

发表于 2020-08-13 11:58:40 回复(0)
这道题纯属失误,考虑两点,索引从0开始 默认值为0
发表于 2020-07-14 07:56:09 回复(0)
数组索引都是从零开始
发表于 2017-03-28 11:21:11 回复(0)
#include <iostream>#include <stdio.h>//1using namespace std;class B//2{//3public:	B()	{		cout <<"constructor called!"<<endl;	}	~B()	{		cout <<"destructor called!"<<endl;	}  B(const B& other) { 	cout <<"Copy constructor called!"<<endl; } B& operator=(const B& other) { 	cout <<"copy assignment oprerator called!"<<endl; 	return *this;  } };//4B func(const B& rhs){//5  return rhs;//6}//7int main(int argc,char **argv){  B b1,b2;//9  b2=func(b1);//10}

发表于 2016-08-05 14:26:14 回复(0)
B
发表于 2015-11-27 13:28:19 回复(0)
这道题纯属失误,考虑两点,索引从0开始 默认值为0
发表于 2015-10-18 18:40:27 回复(1)