Thread: help i need explanation of these codes

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    17

    Question help i need explanation of these codes

    Code:
    main()
       {
      char huge * near * far *prt1;
      char near * far * huge *ptr2;
      char far * huge * near *ptr3;
      printf("%d %d %d", sizeof(ptr1),sizeof(*ptr2),sizeof(**ptr3));
       }
    second prg
    Code:
    main()
       {
      char huge * near * far *prt1;
      char near * far * huge *ptr2;
      char far * huge * near *ptr3;
      printf("%d %d %d", sizeof(*ptr1),sizeof(**ptr2),sizeof(ptr3));
       }

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Outdated, compiler specific, keyword abuse.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    17

    Smile

    Quote Originally Posted by quzah
    Outdated, compiler specific, keyword abuse.


    Quzah.
    ok but can you tell apporach to solve this kind of question

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Do you know what
    Code:
    char huge * ptrHuge;
    is?
    then determine what you got by
    Code:
    typedef char huge * HUGE_CHAR_PTR;
    HUGE_CHAR_PTR near * newPtr;
    comparing it to
    int near* newIntPtr;
    for example
    and so on.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked Lists
    By Bleu_Cheese in forum C++ Programming
    Replies: 13
    Last Post: 12-21-2007, 09:17 PM
  2. codes
    By IfYouSaySo in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 11-18-2005, 03:09 PM
  3. action replay codes
    By c++.prog.newbie in forum Game Programming
    Replies: 2
    Last Post: 02-28-2004, 08:47 AM
  4. anyone have linked-list sample codes?
    By ling in forum C++ Programming
    Replies: 3
    Last Post: 07-03-2002, 02:24 PM