Thread: Couple of questions about XOR linked lists...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by klawson88 View Post
    It's an HW assignment... and my professor told us to use the (unsigned int) typecast.
    S/he surely meant an unsigned int pointer cast, since pointers are all the same size. Also, nextPrev is a pointer to start with, so:
    Code:
    (unsigned int*)list->tail->nextPrev
    If you think about it, you will hopefully see how this could make a significant difference.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    16
    Using that cast causes the code not to compile.... "error C2296: '^' : illegal, left operand has type 'unsigned int *' "

    Ugh... why do I have a feeling that i'm missing something simple?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a couple of questions about System.String
    By Elkvis in forum C# Programming
    Replies: 5
    Last Post: 02-17-2009, 02:48 PM
  2. A couple of Basic questions
    By ozumsafa in forum C Programming
    Replies: 8
    Last Post: 09-26-2007, 04:06 PM
  3. Couple of Questions
    By toonlover in forum Windows Programming
    Replies: 10
    Last Post: 07-14-2006, 01:04 AM
  4. New to C++/ Couple of questions...
    By danielthomas3 in forum C++ Programming
    Replies: 13
    Last Post: 04-14-2002, 03:46 PM
  5. couple questions for newb
    By bluehead in forum C++ Programming
    Replies: 10
    Last Post: 11-24-2001, 03:32 AM