About GBdirect Consultancy Training Development

Section navigation

Leeds Office (National HQ)

GBdirect Ltd
Leeds Innovation Centre
103 Clarendon Road
LEEDS
LS2 9DF
West Yorkshire
United Kingdom

consulting@gbdirect.co.uk

tel: +44 (0)870 200 7273
Sales: 0800 651 0338

South East Regional Office

GBdirect Ltd
18 Lynn Rd
ELY
CB6 1DA
Cambridgeshire
United Kingdom

consulting@gbdirect.co.uk

tel: +44 (0)870 200 7273
Sales: 0800 651 0338

Please note: Initial enquiries should always be directed to our UK national office in Leeds (West Yorkshire), even if the enquiry concerns services delivered in London or South/East England. Clients in London and the South East will typically be handled by staff working in the London or Cambridge areas.

Chapter 6

Exercise 6.1

struct {
  int a,b;
};

Exercise 6.2

Without a tag or any variables defined, the structure declaration is of little use. It cannot be referred to later.

Exercise 6.3

struct int_struc{
  int a,b;
}x,y;

Exercise 6.4

struct int_struc z;

Exercise 6.5

p = &z;
p->a = 0;

Exercise 6.6

Explicitly, for example

struct x;

or implicitly,

struct x *p;

when no outer declaration exists.

Exercise 6.7

It is not treated as a pointer, but as a short-hand way of initializing the individual array elements.

Exercise 6.8

Nothing unusual at all, the string is treated as a literal constant of type const char *.

Exercise 6.9

Yes. It is easier!