In: Computer Science
what does this "->" mean in c? when can you use it?
Please find my answer.
Arrow operator is used for accessing members of structure using pointer variable, below is the syntax of arrow operator in c programming –
Syntax of arrow operator
struct student
{
char name[20],
int roll;
}*ptr;
Access Structure Member Example 1 Example 2
Name is accessed using std.name ptr->name
Roll number is accessed using std.roll ptr->roll