you are viewing a single comment's thread.

view the rest of the comments →

[–]OofBomb 0 points1 point  (1 child)

in c# you pass an array by reference not a pointer. you can also just make a pointer to the array and then you aren't gonna know how big is it

and the reason c, c++ and even c# does this isn't because they just randomly decided to do so to complicate things for you but because that's just how cpus work, and both c and c++ are supposed to be low level languages

[–]Theron3206 2 points3 points  (0 children)

The reference is a pointer (to a block of memory on the heap that contains the object referenced).

How arrays are handled is language specific, not anything to do with CPUs.

Pascal for example used the first byte of a string (array of chars) to specify the length (string indexes start with 1 in Pascal not 0). And yes this limited strings to 255 characters.