neuromancer
neuromancer

Reputation: 55499

Does C use the arrow (->) operator like C++?

I know more C++ than C. Does C use -> for pointers, or is that only used in C++?

Upvotes: 3

Views: 3394

Answers (2)

apbianco
apbianco

Reputation: 174

It is used in both languages.

Upvotes: 2

caf
caf

Reputation: 239041

The -> operator is part of standard C.

(expression)->identifier is equivalent to (*expression).identifier - obviously, for this to be valid, expression must have a type of pointer to structure or pointer to union.

Upvotes: 19

Related Questions