Initialized variables vs named constants
Posted
by
Mike
on Programmers
See other posts from Programmers
or by Mike
Published on 2012-05-31T17:42:57Z
Indexed on
2012/06/01
4:49 UTC
Read the original article
Hit count: 315
variables
I'm working on a fundamental programming class in college and our textbook is "programming logic and design" by joyce farrell(spelling?)
Anyhow, I'm struggling conceptually when it comes to initialized variables and named constants.
Our class is focusing on pseudo-code for the time being and not one particular language so let me illustrate what I'm talking about.
Let's say I am declaring a variable named "myVar" and the data type is numeric:
num myVar
now I want to initialize it (I don't understand this concept) starting with the number 5
num myVar = 5
how is that any different than creating a named constant?
© Programmers or respective owner