I have the following code;
#include <iostream>
using namespace std;
struct Slog1
{
char ime1;
int broj1;
};
struct Slog2
{
char ime2;
int broj2;
};
int main()
{
Slog1 aSlog, bSlog;
Slog2 cSlog;
aSlog = bSlog; // 1
bSlog.ime1 = cSlog.ime2; // 2
aSlog = cSlog; // 3
}
Now, I have declared:
Slog1 aSlog, bSlog;
Slog2 cSlog;
Those are struct variables which I understand very well. And now I have these:
aSlog = bSlog; // 1
bSlog.ime1 = cSlog.ime2; // 2
aSlog = cSlog; // 3
- What does it do exactly? It compiles fine but I'm not sure it does.
- This one I understand well, it sets the member ime1 of bSlog the value of the member ime2 in the cSlog struct.
- Doesn't compile for some reason, but it's the same as 1.