How can i measure (n. of elements) an array by reference it from a pointer? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i measure (n. of elements) an array by reference it from a pointer?

23rd Sep 2017, 7:44 PM
Timo Ramallo
Timo Ramallo - avatar
6 Answers
+ 5
The one I had in ming was for java. The other way is to use a foreach loop fuction to count the array. Not recommended of number values. https://code.sololearn.com/cIdHe7Dqo9kX/?ref=app https://code.sololearn.com/cO2mkNBP194a/?ref=app
23rd Sep 2017, 8:36 PM
Manual
Manual - avatar
+ 3
Depends on the type of array. You need to give details in a question.
23rd Sep 2017, 7:50 PM
Manual
Manual - avatar
+ 3
Edit my mistake. you need to use the (sizeof(Array) / sizeof(int)) in C++ .length is for another language
23rd Sep 2017, 8:19 PM
Manual
Manual - avatar
23rd Sep 2017, 8:04 PM
Timo Ramallo
Timo Ramallo - avatar
0
it is done... using ".lenght" it says that there is an error (request for member 'length' in 'a', which is of non-class type 'int*').
23rd Sep 2017, 8:28 PM
Timo Ramallo
Timo Ramallo - avatar
0
ok thanks. i not wanted to fill that with more code, but if there is not another option ... fuera del tema: hablas espannol? eres moderador de (SL)?
23rd Sep 2017, 8:48 PM
Timo Ramallo
Timo Ramallo - avatar