21 Apr
2012
21 Apr
'12
7:18 p.m.
On Sat, Apr 21, 2012 at 7:42 PM, ZNV
Hi Nat,
I believe the current operator =/ behavior is outright dangerous and
should be fixed.
Nope, sorry. If you pass a fixed-length array, a proper C++ library *should* be sensitive to its max. Anything else is unsafe and should be discouraged.
What if I pass fixed-length array without actually knowing that? There are many C libraries out there assuming char * and char [] are interchangeable. These libraries are well documented.
Even if it is so, taking &arr[0] of char* or char[...] will always have the result type char*. So you don't need to make any checks. The only check needed is that the pointer is not NULL. Or do I oversee smth here?
[...]
Regards, Ovanes