pointer

This is a discussion on pointer within the C Programming forums, part of the General Programming Boards category; Is (*ptr).age the same as ptr->age? Thanks....

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    8

    pointer

    Is (*ptr).age the same as ptr->age?

    Thanks.

  2. #2
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    Yes

  3. #3
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    but why is this on the C board? C doesn't have pointers, but C++ does.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by face_master
    C doesn't have pointers, but C++ does.
    What?? Of course C has pointers
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    it does? I must have been looking at some dodgy internet pages again, then...
    Last edited by face_master; 05-16-2002 at 07:00 AM.

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >C doesn't have pointers, but C++ does.
    ...

    -Prelude
    My best code is written with the delete key.

  7. #7
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > C doesn't have pointers, but C++ does.
    Woah

    > I must have been looking at some dodgy internet pages again
    This should be a crime.

    Code:
    #include <stdio.h>
    
    int main()
    {
    	char * msg = "Hello World";
    	printf(msg);
    	return 0;
    }
    Compile that with a strictly C compiler.

    Code may not be the best, but the point is C has pointers!?!?!?
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Following CTools
    By EstateMatt in forum C Programming
    Replies: 5
    Last Post: 06-26-2008, 11:10 AM
  2. Quick Pointer Question
    By gwarf420 in forum C Programming
    Replies: 15
    Last Post: 06-01-2008, 04:47 PM
  3. Parameter passing with pointer to pointer
    By notsure in forum C++ Programming
    Replies: 15
    Last Post: 08-12-2006, 08:12 AM
  4. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 04:36 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21