The IP addresses used in the Assessed Exercise this year start with the number 10. If your outputs numbers end with 10 instead, the bytes have been printed in the wrong order.
Also, the handout exercise sheet refers to machine A and machine B swapped over by accident at one point. Answers submitted where this swap has consequence are accordingly being accepted as correct as far as possible. Apologies.
Q. In the C/C++ tick exercise 2, it says my header file can only contain 'declarations and not definitions' Does this mean I cannot include type definitions such as typedef struct {int a} MyStruct; or is it just meaning no function definitions?
A. Typedefs are commonly found in header files and this is good and standard practice. This is an important aspect of C and C++ in general.
Since header files are imported into multiple compilation units, they should never contain definitions of functions or static variables, since that will lead to 'double definition' errors at link edit time. It is fine for them to contain declarations, eg of types or function signatures, since that is their main purpose, after all.
For that reason, the C standards term a typedef as a declaration, although semantically, it is really a definition and that can lead to confusion. We are used to that sort of thing in C, where the keyword 'static', applied to what is a static variable in formal computer science terms (ie generally in the static data segment and defined at compile time), changes its linkage visibility rather than making it any more static than it already is. In Java, what they call a verifier is technically a validator and so on, but I've clearly started ranting now, so I'll stop.
Type declarations (or definitions if you must) can be included in more than one compilation unit without double definition errors arising at link time, as they generate no assembly code (apart from debugging information perhaps): specifically they define no labels, so cannot cause double definitions. Note also that template function/method `definitions' are treated in the same way as all other declarations, with the code in them being inlined at every use site with fresh (or local) assembler labels being used at every point where block-structured control flow is converted to assembly language branches or jumps.
Classes, structs and unions can genuinely be declared before they are 'defined'. For instance 'class myclass' is sufficient to introduce a type name that can be referred to using a pointer (eg. 'myclass *myptr = 0'). This works since all pointers share a common size that does not depend on the structure of the referenced instances
END