Author Topic: POINTERS  (Read 1179 times)

thrushitha

  • Full Member
  • ***
  • Posts: 26
POINTERS
« on: August 03, 2011, 10:55:08 pm »
What is the difference between this two

  1)  SGUCHAR *ptr
  2) ( SGUCHAR *) ptr


what does these 2 mean?
 SGUCHAR *ptr = ( SGUCHAR *) ptr ;

thanx in advance

thrushitha

  • Full Member
  • ***
  • Posts: 26
Re: POINTERS
« Reply #1 on: August 04, 2011, 11:10:38 pm »
im waiting for ur reply :)

thrushitha

  • Full Member
  • ***
  • Posts: 26
Re: POINTERS
« Reply #2 on: August 10, 2011, 01:22:47 am »
can u plz reply :)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Re: POINTERS
« Reply #3 on: August 15, 2011, 05:17:35 am »
What is the difference between this two

  1)  SGUCHAR *ptr
  2) ( SGUCHAR *) ptr


what does these 2 mean?
 SGUCHAR *ptr = ( SGUCHAR *) ptr ;

thanx in advance

It is called 'C' style type casting.

For example, if you want to convert int* to void* and then void* to int*, you can do it in the following way:

int m = 20;
int *ip = &m;

void *vp = (void*) ip; // OR
void *vp = (void*) &m;

int *p = (int*) vp;

Hope this helps. For C++ style casting, visit the following page:

http://www.softwareandfinance.com/CPP/Cast_Styles.html





thrushitha

  • Full Member
  • ***
  • Posts: 26
Re: POINTERS
« Reply #4 on: August 16, 2011, 02:09:16 am »
thanx a lot :)
dis site s really usefull, i liked it a lot :)

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1