![]() |
| | #1 |
| Registered User Join Date: Mar 2006 Location: Bangalore, INDIA
Posts: 43
| facing problem in understanding this.... I'm facing one more problem, i'm not able to understand the below way of casting, whats actually happening here.... Code: #define X(t,m) (size_t) ( (char *) &((t*)0)->m - (char *)(t*)0) |
| enggabhinandan is offline |
| | #2 |
| pwns nooblars Join Date: Oct 2005 Location: Portland, Or
Posts: 1,094
| Go to your teacher and request either some tutoring or to be removed from the class. Or really just read your book or pay attention in class. In anycase stop posting every little question you get. |
| Wraithan is offline |
| | #3 |
| Registered User Join Date: Oct 2006 Location: Canada
Posts: 1,219
| it looks like: the address of member 'm', from (t) pointer 0.. heh, its really confusing. break it up into parts to visualize what it is: Code: &( )->m <---- 'address of' member variable 'm', from this object:
(t*) 0 <---- zero casted to a 't' pointer.. which is NULL
|
| nadroj is offline |
| | #4 |
| Registered User Join Date: Mar 2006 Location: Bangalore, INDIA
Posts: 43
| Thanks Nadroj....thank u very much and Wraithan if u dont want to suggest then please keep quiet, the forums are present to help the people who are studying on there own. i'm studying on my own and if i find any problem in understanding then ofcourse i will seek the help in this forum, if u r not interested in answering then why cant u be quiet..... |
| enggabhinandan is offline |
| | #5 |
| pwns nooblars Join Date: Oct 2005 Location: Portland, Or
Posts: 1,094
| Most of your questions so far have either been homework/exam questions. And the others with a little googling you would have found the answers. Refer to the link in my sig for a more indepth reasoning. |
| Wraithan is offline |
| | #6 |
| Registered User Join Date: Mar 2006 Location: Bangalore, INDIA
Posts: 43
| i had taken few tests online to check my level of understanding and those question were the one which i never went through and could not understand at all.....for u it may look like very silly but for me a small thing information makes lot of difference.... |
| enggabhinandan is offline |
| | #7 | |
| Registered User Join Date: Oct 2005
Posts: 217
| Quote:
| |
| MacNilly is offline |
| | #8 |
| Its hard... But im here Join Date: Apr 2005 Location: England
Posts: 1,467
| On a side note I hate using #define. I only use it when using header gaurds in header files But #define is used much more in C than C++. I usually use a constant variable instead |
| swgh is offline |
| | #9 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Looks like an implementation of the offsetof macro to me. These things are not to be looked at, IMO.
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline |
| | #10 | |
| Registered User Join Date: Jun 2005
Posts: 10
| Quote:
Code: &((t*)0)->m Code: (t*)0 | |
| kevin_cat is offline |
| | #11 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,630
| Need to find the solution for the Macro Not showing effort gets you black marks Repeatedly asking the same question isn't good either. |
| Salem is offline |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WS_POPUP, continuation of old problem | blurrymadness | Windows Programming | 1 | 04-20-2007 06:54 PM |
| facing problem with Buffer | enggabhinandan | C Programming | 5 | 11-22-2006 06:26 AM |
| Problem related to string class & lpthread on HP-UX 11iV2 | molus | C++ Programming | 2 | 06-21-2006 04:23 AM |
| Laptop Problem | Boomba | Tech Board | 1 | 03-07-2006 06:24 PM |
| Sorting problem.. well actually more of a string problem | fatdunky | C Programming | 5 | 11-07-2005 11:34 PM |