Solved

Quick fast operator question

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

0
Comment
Question by:jameswalt
  • 4
6 Comments
 
LVL 84

Accepted Solution

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

Assisted Solution

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

0
 

Author Comment

by:jameswalt
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 ?
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

Author Comment

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

Author Comment

by:jameswalt
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]   };
0
 

Author Comment

by:jameswalt
ID: 12080748
figured it out

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

770 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