len(a)
or a.size
but the same lack of bounds checking that makes the return after a strcpy Turing complete bites you there.(2) I'd also be angry all the time if I was looking to StackOverflow for answers because the moderation system being ineffective (for plain ordinary problems, never mind the ontologically challenged problems like this one) is just one of the many quality problems, such as all the Python 2 answers that would be valid Python 3 answers if only
print x
was rewritten to print(x)
With all the excuses from people who think "you shouldn't cut and paste code anyway so it's a good thing that the code doesn't work" and the burden of doing that kind of maintenance work is greatly magnified because SO has at least 10 or bad mediocre answers for each good answer.(3) A major factor behind "enshittification" is that given the two-sided market reality it is almost impossible to kill or displace a successful site. For instance Twitter lumbers on despite Musk making every effort to kill it short of actually pulling the plug.