Ist es normal, dass dieser Code nicht funktioniert?
Code: Alles auswählen
int Test[][] = {
{ 0, 1, 2 },
{ 3, 4, 5 }
};
Gruß, Ky
Code: Alles auswählen
int Test[][] = {
{ 0, 1, 2 },
{ 3, 4, 5 }
};
C++-Standard hat geschrieben: D1 [ constant-expression opt ]
When several “array of” specifications are adjacent, a multidimensional array is created; the constant expressions that
specify the bounds of the arrays can be omitted only for the first member of the sequence. [ Note: this elision is useful
for function parameters of array types, and when the array is external and the definition, which allocates storage, is
given elsewhere. —end note ] The first constant-expression can also be omitted when the declarator is followed by an
initializer (8.5). In this case the bound is calculated from the number of initial elements (say, N) supplied (8.5.1), and
the type of the identifier of D is “array of N T.”
Nagut, nennen wir es aus bestimmten Blickwinkeln inkonsistent. Der Auszug hat es aber nun geklärt … schade drum, aber traurige Gewissheit ist besser als garkeine … danke dafür.Aramis hat geschrieben:'Problem' ist wohl das falsche Wort ... :-)