Sujet : Re: technology discussion → does the world need a "new" C ?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 16. Aug 2024, 18:56:30
Autres entêtes
Organisation : None to speak of
Message-ID : <87jzgge4hd.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
David Brown <
david.brown@hesbynett.no> writes:
[...]
In C++, you can't pass arrays as parameters at all - the language
inherited C's handling of arrays. You can, of course, pass objects of
std::array<> type by value or by reference, just like any other class
types.
#include <cassert>
typedef int array42[42];
void func(array42& param) {
assert(sizeof param == 42 * sizeof(int));
}
int main() {
array42 arg = { };
func(arg);
}
I suggest that this is not the best place to discuss the nuances of C++.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */