c++ explanation

c++ array and the use of * in char *rTemp

Page 1 of 1

2 Replies - 554 Views - Last Post: 07 February 2010 - 05:46 AM Rate Topic: -----

#1 shoe_mart  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 06-February 10

c++ explanation

Posted 06 February 2010 - 07:36 PM

hello sir, madam. I am new in c++. And we need to explain the work our teacher. but i don't know why did he use *rTemp. what is the use of the asteris (*) in the variable? is it only an ordinary variable or it has a deeper meaning? please help me. thanks.
Is This A Good Question/Topic? 0
  • +

Replies To: c++ explanation

#2 Ancient Dragon  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 81
  • View blog
  • Posts: 679
  • Joined: 19-July 09

Re: c++ explanation

Posted 06 February 2010 - 07:46 PM

The star indicates that it is a pointer.
int *rTemp
is a pointer to an integer. If you are not familiar with pointers then you should read about them in your text book. There are also several tutorials on the net.
Was This Post Helpful? 0
  • +
  • -

#3 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 857
  • View blog
  • Posts: 2,343
  • Joined: 20-August 07

Re: c++ explanation

Posted 07 February 2010 - 05:46 AM

Your text book and/or your tutor should always be your first point of call for these types of questions; If you need more information, then have a look at these links:

http://www.daweidesi...in/pointers.php
http://www.eternally...t_pointers.aspx
http://www.augustcou...torial/ptr.html
http://www.c-faq.com/aryptr/index.html
http://cslibrary.stanford.edu/104/
http://www.codeproje...clarations.aspx
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1