You are here:

C++/Relation..

Advertisement


Question
what is the relation between variables and array? Are they the same?

Thanks

Answer
They are not the same. A variable stores one instance of the type.

int Var;

stores one in access in a program as Var.  An array holds 1 or more instances of the type using a single name and a subscript (which is an operator) to access one item.

int Array[10];

hold 10 ints.  Array[0] is the first and Array[9] is the last.

Bill

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill A

Expertise

I can answer questions about C++, programming algorithms, Windows programming in MFC (which is C++). I cannot answer questions about STL (templates) and I have no experience with Linux. I do enjoy reviewing code and critiquing it or finding problems in it. I will also gladly show better algorithms or methods if you want to take advantage of that.

Experience

I've developed a commercial embedded C compiler/assembler and IDE with debugger toolset, of which the IDE and debugger are written in C++. I work in the industry writing high tech embedded programs and Windows programs to communicate with the embedded devices.

Publications
Book: Embedded Systems Design using the Rabbit 3000 Microprocessor Authored Chapter 10 in its entirety.

Education/Credentials
BS Computer Engineering

©2016 About.com. All rights reserved.