Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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