Solved

Quick fast operator question

Posted on 2004-09-16
6
219 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

760 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

17 Experts available now in Live!

Get 1:1 Help Now