2 ms·
There's also a handful of small differences like this, e.g. in C it's possible to construct a value and take the address for a pointer argument right in the fun
by flohofwoe 6y ago
There's also a handful of small differences like this, e.g. in C it's possible to construct a value and take the address for a pointer argument right in the function call:
func(&(bla_t){ .x=1, .y=2 });
This is completely valid C, but invalid C++ (C++ has references as "workaround" for such adhoc-constructed parameters which shouldn't be passed by value).
- pjmlp 6y agoYes, that falls under my "type safety semantics are stronger" part of the comment.