Quick fast operator question

Posted on 2004-09-16
Last Modified: 2010-04-15
What does the -> operator mean?

Question by:jameswalt
  • 4
LVL 84

Accepted Solution

ozo earned 70 total points
ID: 12080625
a->b is the same as (*a).b
LVL 23

Assisted Solution

brettmjohnson earned 20 total points
ID: 12080628
-> is pointer-to-structure de-reference.


Author Comment

ID: 12080714
I have data structure hostent *hp and char[i][j] p

how do I set p[0] = hostname, getting hostname from hostent->h_name ?
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!


Author Comment

ID: 12080716
(that was part 2... points have been increased)

Author Comment

ID: 12080734
struct hostent {      char  *h_name ;     char **h_aliases ;      int    h_addrtype ;      int    h_length ;       char **h_addr_list ;   #define h_addr   h_addr_list[0]   };

Author Comment

ID: 12080748
figured it out

strcpy( playerhosts[0] , ihp->h_name );

Featured Post

Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now