Question: I am reading a book called C for Java Programmers. 
It gives an example about nameless structs that I do not undestand.
It says that this is valid:

```
struct{
 int val1, val2;
 double val3;
} s1,s2;

  s1.val1 = 5;
  s2.val3 = 4.6;

```

If structs are similar to objects in Java, why can't I just say val1 = 5 and val2 = 4.6?
What is the point of s1 and s2?

Thanks

Answer: 
To initialise a `struct` variable you need to add an appropriate initialiser:

```
struct 
{
  int val1, val2;
  double val3;
} s1 =
{
  1, 2, 3.
};

```
A `struct` in C is like an object in Java. But C has no classes, so there really isn't a need to name the type. I.e., you could say:

```
struct something {
   int a, b;
   double c;
};

```

and later say:

```
struct something s1, s2;

s1.a = 42;
s1.c = 2.14;
s2 = s1;

```

In the common case that you only define a few objects of that type, it may remain nameless (as in your snippet). The members `a`, `b`, `c` of `s1` and `s2` are different, just like if you have several objects of the same type in Java their members are separate values.