Last week, and last night we covered C++ pointers, basically it seems to boil down to the following bits. A pointer to an integer object which contains the value 1, can be written as:
int* fred = new int( 1 );
which can be split into three parts:
a. int* fred which declares fred as a pointer to an integer.
b. fred = new int; which allocates enough memory to hold the integer to which fred points
c. *fred = 1; which puts the value of 1 into the object to which fred points ( or *fred )
Pointers can be passed to and returned from functions ( and also need to be deleted in certain circumstances which didn’t get explained), if a pointer is passed into a function then, the object to which it points can be altered, and the ampersand used when we pass by reference is also an address, thereby providing us with a pointer to something.
Have been incredibly busy over the last two weeks. So haven’t posted for ages. First of all, it was my birthday on the 28th of April, so I got lots of nice presents etc. Then on the 29th I went to the Water Park, an Activity Centre at the Southern tip of Coniston, where we did various things like Ghyll scrambling:
then we canoed out to an island and did a bit of clambering round on the rocks:
On the Sunday we went scrambling and hill walking near Old Man of Coniston, and then came home. I spent most of last week in a knackered haze and didn’t start coming round until the weekend when I got lots of sleep.
I’ve picked up a copy of SELECT SSADM Case tool from college so that I can do my Information Systems Assignment this weekend from home (it was only a fiver), as the weekend after its Spud’s christening and we’ll be rammed with relatives and friends all weekend long, not actually very conducive to study.
Have decided to have a new type of entry entitled “coding” as part of the blog so that I can keep the other bits separate.