Thread: Hoy! What is void*?

  1. #1
    Stressed Student :(
    Join Date
    Feb 2008
    Location
    Berkeley, CA
    Posts
    73

    Hoy! What is void*?

    Hi guys! I'm looking at this block of code right now. Can someone quickly explain to me what void* means? This is for my last C project this semester, and yes I'm starting REALLY early this time!

    Code:
    union { 
        void* datax;
        unsigned int val;
      } lr;
    } block
    ;

  2. #2
    Stressed Student :(
    Join Date
    Feb 2008
    Location
    Berkeley, CA
    Posts
    73
    Oh, nevermind, I've found the answer. Now I'm just wondering how to cast it to an unsigned int pointer...

  3. #3
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    (unsigned int *) datax, perhaps?

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Actually, in C you don't need to cast it at all

Popular pages Recent additions subscribe to a feed