pointer tutorial ???


     Could someone explain to me why should I use pointer. Why would I want to know for example the memory adress of a variable (&c1). What's  so impressive about pointer and why should I use them ??????

      Sorry for that long question.
Who is Participating?
NetminderConnect With a Mentor Commented:
Per recommendation points refunded and question closed.

Community Support Moderator
Experts Exchange
See http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20133833 and delete this one to have your points refunded...
some of the nice things that you can do with pointers :
as you know, a function can have only one return value. a function cannot, for example, return a success/failure status and at the same time return a 'real' value (calculation result, some kind of string or whatever). you can solve the problem with global variables, but that it ugly and unsafe. with pointers, you can send to a function parameters which are actually addresses of variables, and the function can fill those addresses with data, which you can read later, when the function returns. so you have multiple returned values from a function.

another thing is scanning arrays - doing it with a pointer is faster than doing it with indexes.

a third thing is passing structs as parameters to functions. a struct 9or an object in C++) may be very large, and passing it by value will catch a lot of memory on the stack. passing a pointer is no more than 2/4 bytes...

and a very important usage of pointers is the dynamic allocation of arrays. you do not always know in advance the size of an array that you will need (for example - an array to hold the grades of students in a class. you don't know the number of students that will be when the program is run. if you 'hard code' an array of a specific it will probably be too big - memory wasted or too small - not enough room for all grades). with a pointer and a dynamic allocation during run-time you solve the problem.

there are many more reasons, but maybe you are already aware of the importance of pointers.
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Write your EMail and I 'll send you Pointer tutorial
For a tutorial on pointers check www.codeproject.com and look in the tutorials section
All information is here:


Keep following things in mind while learning pointers whenever u see any expression.

address = address
value = value

and A[i] = *(A + i)
   A[i][j] = *(A[i] + j) = *(*(A+i) + j))
   A[i][j][k] = *(A[i][j] + k)
              = *(*(A[i] +j ) + k))
              and so on.......

Thanks and Best Regards,
Two of your posted links, are exactly the same.
Two of your posted links, are exactly the same.
Thanks Axter,
It is because of 'copy and paste'funda.
The third link is
actually,we dont REALY need pointers,but they make our lives as programmers alot easier.
for ex.:if you have an array of 10 items(or whatever),nad you want to go to each one in any time,you can go by calling the name of the array and adding the place of the wanted item.the NAME of this array,is actually the name you have (unawer)gave to a pointer,who points to the address where this array starts.so when you go to the item,you realy go to the X places after the beginning address.
when you dont want to burden(overload,i forgot how to write it) the computer,you can use DYNAMIC memory.this will alow you to move freely around the items,AND(the most important thing!!)-you dont have to know the size of the array at beginning of your program!!
say,you awnt to get some names,but you dont know how many names you are going to get.you can use a dynamic array,and then add each name as you go along.but since you dont realy know where this array seats,you need something to point out to you the starting point of the array,so when you want to do something with these names,you can get to them.so you define a pointer,which you later give a value,and TIHS pointer is the thing that makes you go wherever you want in this array,just as if it was a normal array...
TimCotteeHead of Software ServicesCommented:
Sorry guys to hijack this thread but deschenesp has a number of outstanding ungraded questions, specifically of interest to me is http://www.experts-exchange.com/jsp/qShow.jsp?ta=vbdatabases&qid=11272334 this has been outstanding for more than 6 months.

deschenesp, failure to maintain your questions may be considered sufficient grounds for suspension of your account. I strongly suggest that you clean up the outstanding questions as soon as possible.
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to refund the points PAQ at zero points since your question was alredy answered in http://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20133833 .

The link to the Community Support area is: http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.