Portál AbcLinuxu, 9. května 2025 19:42
using namespace std;
struct Prom {
int Prvni;
int Druhy;
};
int main() {
Prom pole[10];
pole[1] = {14, 15};
}
syntax error : '{'
syntax error : missing ';' before '{'
syntax error : missing ';' before '}'
nechapu, co delam spatne...? dekuji za odpovedi
struct Prom
{
int Prvni;
int Druhy;
};
int main()
{
struct Prom prvek, pole[] = {{1,2}, {3,4}};
prvek.Prvni = 5;
//pole[0] = {1, 2}; // nefunguje ale asi by melo ...
pole[0] = prvek; // funguje
}
http://www.cs.princeton.edu/~lworthin/126/precepts/structs.html
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.