Thread: pointer question

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    4

    pointer question

    i have a value inside of (struct sockaddr *)&address and i was wondering how I could dereference that

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Code:
    	sockaddr_in s;
    
    //	s.sin_addr = blah;
    //	s.sin_family = blah;
    //	s.sin_port = blah
    
    	((sockaddr*) &s)->sa_family
    	((sockaddr*) &s)->sa_data
    Edit: Why are there 1,000+ views?
    Last edited by Tonto; 03-12-2006 at 04:22 PM.

  3. #3
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    >>Why are there 1,000+ views?

    A pointer is worth a thousand views...?
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  4. #4
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    Maybe that would explain the recent server slowdown

  5. #5
    User
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    499
    I bet the server messed up. There's no way 1000+ people would go directly to this thread and not to any others.
    i have a value inside of (struct sockaddr *)&address and i was wondering how I could dereference that
    I don't see what's wrong with it.

  6. #6
    Registered User
    Join Date
    Nov 2004
    Posts
    10
    Quote Originally Posted by JaWiB
    >>Why are there 1,000+ views?

    A pointer is worth a thousand views...?

    oh god, ive hit a new low in my computer nerdness, but that totally cracked me up

  7. #7
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    heeeheee, yeah..

    strange how I get it ....

    cuz you can create multiple pointers to view the same thing..

    hahah...

    I'm gonna go to a corner now and cry at my nerdyness....
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  2. Easy pointer question
    By Edo in forum C++ Programming
    Replies: 3
    Last Post: 01-19-2009, 10:54 AM
  3. char pointer to pointer question
    By Salt Shaker in forum C Programming
    Replies: 3
    Last Post: 01-10-2009, 11:59 AM
  4. Pointer question
    By rakan in forum C++ Programming
    Replies: 2
    Last Post: 11-19-2006, 02:23 AM
  5. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM