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

What is rvalue?

0 Answers  


What is the difference between #import and #include?

0 Answers  


What are the comments in c++?

0 Answers  


What do you mean by global variables?

0 Answers  


why we cant create array of refrences

4 Answers  






What is the operator in c++?

0 Answers  


Explain about Virtual Function in C++?

0 Answers  


Can we use this pointer inside static member function?

0 Answers  


What is a pointer how and when is it used?

0 Answers  


How can you quickly find the number of elements stored in a a) static array b) dynamic array ?

5 Answers   Lucent,


What is else syntax in c++?

0 Answers  


Why are pointers not used in c++?

0 Answers  


Categories