Is there already a way where I can initalizeinitialize an array directly in thea struct ?
like Like this ?:
struct S { int arr[50] = {5}; } I know this only initializes the first element of the array, but is there any way to write something similar with the G++ compilerg++ but that can initialize all elements of the array with 5?
I've read that with GCC Compilergcc, we can use designated intiializersintializers int arr[50] = {[0 ... 49] = 5}; but this won't be possible in C++.