Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Very Basic Question

Options
  • 31-10-2007 5: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 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