how is returning structurs from functions?Show an eg?



how is returning structurs from functions?Show an eg?..

Answer / ravi.g

struct student
{
int age;
float percntg;
};

struct student s1;

int a=25;
float p=88.99;
student assign(a,p)
{
student s2;
s2.age=a;
s2.percntg=p;
return s2;

}

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More C++ General Interview Questions

Write about the role of c++ in the tradeoff of safety vs. Usability?

0 Answers  


Explain queue. How it can be implemented?

0 Answers  


What is the purpose of decltype?

1 Answers  


Differentiate between the message and method?

1 Answers  


What is the use of vtable?

0 Answers  


What are the basics of classifying different storage types, why?

2 Answers   Astergate, Symphony,


What is virtual constructor paradigm?

5 Answers   HCL, HP,


Why pointer is used in c++?

0 Answers  


What is data types c++?

0 Answers  


What are libraries in c++?

0 Answers  


Explain differences between alloc() and free()?

0 Answers  


What is the size of pointer ? Also size of pointer in 64 bit pointer

4 Answers  


Categories