please explain

int num[5];
int *ptr;
here we use num[] to refer individual cells or data stored in it?
is ptr[] and num[] any kind of operations,coz both of them is giving the data stored in respective memories
int num[5] is an array of consecutive memory locations that all have the size of int. you access each element by giving an index within the brackets.

Visually it looks like this:
[memory][memory][memory][memory][memory]
vw4x4 (21)

You seem to ask a lot of these trivial, pedantic questions - anyone might think that you are trolling.
anyone might think that you are trolling.


I tend to think very lazy student for whom English is a second language. I like to attribute to laziness ahead of malice :)
If it is just laziness, try reading these tutorial chapters. They will cover your question.

http://cplusplus.com/doc/tutorial/arrays/
http://cplusplus.com/doc/tutorial/pointers/
Topic archived. No new replies allowed.