what are the differences between these two arrays? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

what are the differences between these two arrays?

float A[20,4,6] double B[i][j][k]

20th Nov 2020, 7:17 PM
Coder
Coder - avatar
3 ответов
+ 3
Apart from the type (float for one and double for the other) the first is a one-dimentional array with 3 subscripts and the second a 3D array with i*j*k subscripts edit: sorry I know only C and I thought I saw A[]={20,4,6}; that is a one-dimentional array with 3 subscripts. The thing you wrote is illegal in C. But possibly in another language is actually a one-dimensional array with 3 subscripts.
20th Nov 2020, 8:40 PM
Davide
Davide - avatar
+ 1
yamila blanco *please remove your spam Please do not create spam threads or add spammy comments to an existing thread. Both are seen as negative behavior. Thanks and happy coding https://code.sololearn.com/Wv5gTHy1N6Ji/?ref=app
1st Dec 2020, 2:18 PM
BroFar
BroFar - avatar
0
I don't know much python, but in java, the first one is wrong ,you need to to define the array as float[] A = {20, 4, 6}; , and the second one is wrong too, you need to define the array as double[][][] B = new double[i][j][k];
21st Nov 2020, 1:07 AM
pNK
pNK - avatar