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.
};

```
That is a nice and elegant way of doing so:

```
struct s {
  int val1, val2;
  double val3;
};

struct s s1 = {
  .val1 = 1,
  .val3 = 3.1444
};

```

`s1.val2` will be set to `0` by the compiler. It is commonly used in [linux kernel source code](http://lxr.free-electrons.com/source/arch/arm/mach-mmp/aspenite.c#L185).