• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Quick fast operator question

What does the -> operator mean?

0
jameswalt
Asked:
jameswalt
  • 4
2 Solutions
 
ozoCommented:
a->b is the same as (*a).b
0
 
brettmjohnsonCommented:
-> is pointer-to-structure de-reference.

0
 
jameswaltAuthor Commented:
I have data structure hostent *hp and char[i][j] p

how do I set p[0] = hostname, getting hostname from hostent->h_name ?
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
jameswaltAuthor Commented:
(that was part 2... points have been increased)
0
 
jameswaltAuthor Commented:
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]   };
0
 
jameswaltAuthor Commented:
figured it out

strcpy( playerhosts[0] , ihp->h_name );
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell┬« is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now