Computer Science, asked by sneetu4979, 1 year ago

Why we can't use arrow operator in gets and puts?

Answers

Answered by Aditi6106
0

The -> (arrow) operator is used to get a field / call a method from the content pointed by the class. The simplest difference between the two is that "->" dereferences a pointer before it goes to look at that objects fields, function etc. whereas "." doesn't dereference first.

What is the use of arrow operator?

The dot ( . ) operator is used to access a member of a struct, while the arrow operator ( -> ) in C is used to access a member of a struct which is referenced by the pointer in question.

The dot and arrow operator are both used in C++ to access the members of a class. They are just used in different scenarios. In C++, types declared as a class, struct, or union are considered "of class type". So the following refers to both of them.

The addition operator tells the compiler to add both of the operands 'a' and 'b'. C/C++ has many built-in operator types and they can be classified as: Arithmetic Operators: These are the operators used to perform arithmetic/mathematical operations on operands. Examples: (+, -, *, /, %,++,–).

Similar questions