Techiio-author
Started by Anik AdhikaryMay 4, 2022

Open
what does a dot do (example a.b) in C programe?

3 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 3 VIEWES SHARE

Anybody,please explain it......

2 Replies

Techiio-commentatorSidhdarth Basu replied 12 days ago0 likes0 dislikes

>

In C/C++ The dot (.) operator is used for direct member selection via object name. In other words, it is used to access the child object.

Techiio-commentatorAllen Scott replied 10 days ago0 likes0 dislikes

The dot operator is used when we want to access some data within a struct.

#include <stdio.h>

struct Pair {

int first, second;

};

int main(void) {

struct Pair p;

p.first = 10;

p.second = 20;

printf("%d %d\n", p.first, p.second);

}

For example, the above code implements a pair of integers.

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance