• Introduction to C/C++

    Nov 14, 2009

    In my Programming module we are learning the C language currently (C++ later this year).

    In this blog I hope to display the uses of each concept that we are taught as we are taught it. Hopefully updating with a new program/some code weekly, possibly displaying the output unless it becomes too large.

    At this point (28/10/09) I'm unsure as to whether or not I will be able to provide colour syntaxing into my blog.

    I am also not confining to standards at the moment. But this may change once we become aware of them or they are introduced in lectures or practicals.

    In order to practice the correct methods of programming correctly I intend to show a brief explanation of the process of creating the program before writing the program itself. This is to develop a problem solving outlook to the program. In the future I hope that this will prove useful to my future development projects.

    In the problem solving process, however, I would, in a real situation provide pseudo code before writing actual code. At the moment as the programs I am writhing here are relatively simple and will be commented to describe how the code operates I will be omitting this.

  • Tech: 14/11/09 Stuff

    Nov 14, 2009

    Call of Duty: Modern Warfare 2
    Infinity ward seems to have done it again! Over 1.2 Million copies sold in the UK alone on the first day. The estimate is £180M+ of profit for Activision on this title on the first day alone. Being at University without an Xbox I am unable to have an opinion on this game, however, if the first of the Modern Warfare series is anything to go buy it would surely be amazing. Having racked up a shameful number of days play time and ranking on MW1 I think it is probably for the best that I do not have my 360 up here with me with all the temptations and distractions it would bring.
    iPhone on Orange
    After the exclusivity ending on the O2 network. Orange had sales of over 30,000 handsets on the first day of it being available! The revenue that must have generated for them would be incredible. Sadly though they did not challenge the prices of O2 for the tarrifs, which might have swung me away from my BlackBerry Bold 9000.
    BlackBerry
    These devices have caught my eye lately with the subtle improvements of the Bold and the better sounding Multi-Touch features of the Storm 2. Being halfway through my contract with Orange it is too soon to go dreaming on owning either of these handsets. One thing that recently caught my eye was the OpenGL ES Support on the Storm2 (and maybe more) 3D graphics for games or applications? Yes please. This is one huge way that RIM could possibly compete with something as readily available and consumer oriented as the iPhone.
    In my experience with the Bold I found the worst thing to be was the Browser. Slow loading, non-native drawing and some poorly interpreted pages put me onto a new browser 'Bolt'. This browser loads far quicker than the native browser. Being that browsers are one main reason that a person would go for a smart phone over a non-smart phone I think they could much improve this. As it stands now though there are rumours of a new browser being developed by RIM. I look forward to this and the release of the new 5.0 OS by RIM.
    Wondering whether I would like to develop an application for BlackBerry at somepoint. As of yet I lack the skills, determination and most of all the idea of an application though. We shall see...

  • Autumn Term - Halfway Through

    Nov 11, 2009

    I have been at university for over a month now. I think during this time I have been far more motivated to learn than I was when I was back at home in college. The workload hasn't been quite the volume I had come to expect but I think that may be because the lecture cover things in great detail along with the benefit of having done Computing at A' Level. That gave me a good boost into most of the modules I have this year. The Mathematics for Computer Science Module (MA116) seems to be picking up at quite a pace. Already having gone through most of the first year of A' Level's topics and on to some Further Maths, such as imaginary numbers.
    I am enjoying Programming (SE1SA5) even more now. It has been filling in the gaps that I had made whilst trying to learn C++ myself along with an explanation as to why they are used. It seems to be a much more practicality based course than the books I had looked at on the language. Soon Structs, Compilation units and files are coming up. Very little of which I have looked at or learnt about before so lectures should grip me more!
    Starting to really want to have my Xbox 360 (Eldernas) up here. Since the release of Call of Duty: Modern Warfare 2 I noticed so many of my friends on it. I think it is for the best that I don't have it here though as I think it would prove to be more of a distraction than anything else and if the workload got heavier it may prove difficult to get the work done to a high enough standard to meet my own satisfaction.
    I have still been wondering why the sound of my Bass (Ibanez EDB 400) is so poor. It may have been the battery explosion inside it that had some effect. At University, however, it is fairly irrelevant as I don't have an amp here; out of the two I own I only really like the sound of my Ashdown MAG C210T 300 EvoII Combo. At 35Kg and the size it is, and the power I cannot have it here with me.
    May post a blog soon about Hall life here sometime.

  • C Reference Program 1

    Oct 29, 2009

    Description
    A C program to demonstrate the uses of:
    Variables (static, external): Integers, Floating point numbers, Characters, Arrays, Character Arrays (strings). Enumerators, printf(); function, Mathematical operations, type casting.
    Analysis
    In order to demonstrate the uses and applications of each of these a program, which uses each, should be produced providing output for the user to see.
    Design
    Without using functions/procedures other than main ();
    Initially demonstrate the use of printf(); with 'Hello World'.
    Initialise each variable type (so far) with a value and use printf(); to display these values.
    Comment each printf(); to show readers what it is used for.
    Demonstrate a simple use of Enumerators.
    Extensively comment on the code to explain what is happening and when.
    Implementation
    You are welcome to download this program's code should you wish to run it.

    Code
    Syntax highlighting thanks to pastie.org
    C/C++ Program 1
    Example Output:

    Screenshot of C/C++ Program 1
    Screenshot of C/C++ Program 1
    Thanks to Shirley Williams for spotting my initial mistake of not casting a conversion correctly.