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

How do you write a function that can reverse a linked-list?

0 Answers  


What do you mean by function overriding & function overloading in c++?

0 Answers  


what are the events occur in intr activated on interrupt vector table

0 Answers   HGS,


What is the difference between a "copy constructor" and an "assignment operator" in C++?

0 Answers   Genpact,


What is meant by iomanip in c++?

0 Answers  


CAN U SAY WHICH PROGRAMING LANGUAGE IS USED BY DOCTORS....?

1 Answers  


Explain method of creating object in C++ ?

0 Answers   Wipro,


What sorting algorithm does c++ use?

0 Answers  


How the delete operator differs from the delete[]operator?

0 Answers  


What do you mean by static variables?

0 Answers  


why and when we can declar member fuction as a private in the class?

0 Answers  


What are enumerations?

0 Answers  


Categories