How compiler determines a quantity of array's dimensions at parameter description point? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How compiler determines a quantity of array's dimensions at parameter description point?

I mean that actually I can apply a 2 dimensional array as a parameter of function printArray(int arr[], int size) or not? Does this pursuit reglamented?

24th Apr 2017, 8:16 AM
ŠŸŠµŃ‚Ń€ ŠœŃƒŃ…Š°Ń‡ŠµŠ²
ŠŸŠµŃ‚Ń€ ŠœŃƒŃ…Š°Ń‡ŠµŠ² - avatar
1 Resposta
0
When you pass an array as a parameter, you're not actually passing the content (and thus the size) of the array itself ā€“rather, you pass a pointer to the array: some kind of indicator of where the array begins, in terms of memory allocation.
25th Apr 2017, 6:01 AM
Ɓlvaro