Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Very Basic Question

  • 31-10-2007 05:55PM
    #1
    Closed Accounts Posts: 445 ✭✭


    Im not exactly into computers & ****.

    But need to know this.

    When you say a field is initial, does that mean it is blank or has a value of zero?

    Does a field with zero be regarded as initial too?


Comments

  • Registered Users, Registered Users 2 Posts: 413 ✭✭ianhobo


    Do you mean initialised? rather than initial?
    And what "field" are you refering to?

    In programming in general, when you want to store a number or other variable to use in your program, you "declare" it to the computer and give it a name. The computer/compiler now knows that this will exist. at some stage in the program. So for example you would declare "int x;" At some point in the life of the program a variable called x will exist.
    The problem is that the memory in the computer that has been set aside for x hasn't been initialised yet or set to known value. If you were to use x, or perform some calculation, you could get unknown/unexpected results.

    In order to prevent this, you initialise your variables so that you know what values they are before you start using them.
    ex: int x=0;
    i hope that helps!


Advertisement