Low Level Programming Sessions Summary 13
20th January
The first lecture back was somewhat taken up by discussion of the coursework feedback, which I actually did fairly well in I am glad to say. Though I appreciate there could have been things which I did better. For starters, my initalisation on the heap could have been better, and I did have a few memory leaks when I did. I will have to watch that in the future. There were also general little errors with my use of OOP for two of the three tasks. I could have used it better, but I did so well with snake, which I was quite happy with.
We also talked a little about preprocessor directives and their uses. Preprocessor directive are essentially what we tell the preprocessor to do when we compile our code. It can replace parts of the code and insert libraries using the #include directive.
We can use #if and #define to set up variables ready for run time, and we can also split the code into sections. For instance, we can give the preprocessor a directive to detect which OS we were using, and only complie code for that OS.
We also discussed template classes which are funcions and classes that we can work with that work with any time, independent of what we are working with. These are called templates. They allow us a type safe way of creating generic functions for what we think we will use multiple types for.
No comments:
Post a Comment