Interviewer And Interviewee Guide

C++ Syntax Interview Question:

How to access a variable of the structure?

Submitted by: Muhammad
To access a variable of the structure it goes:

name_of_single_structure.name_of_variable;
For example:
struct example {
int x;
};
struct example an_example; //Treating it like a normal variable type
an_example.x = 33; //How to access its members
Submitted by: Muhammad

Read Online C++ Syntax Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.