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 a dynamic binding in c++?

0 Answers  


int main() { int i ,a[i]; i = 0; a[i] = 10; cout<< a[i] << endl; return 0; } What will be output of this program?

11 Answers   HCL, Mphasis,


What are the uses of pointers?

0 Answers  


structure contains int, char, float how it behaves for big endian and little endian?

1 Answers   BITS,


Why c++ is created?

0 Answers  






What are the two types of comments, and how do they differ?

0 Answers  


Explain the different access specifiers for the class member in c++.

0 Answers  


In C++ cout is: a) object b) class c) something else

11 Answers   Infosys, Lehman Brothers,


What is conversion constructor?

2 Answers   TCS,


When you overload member functions, in what ways must they differ?

0 Answers  


What is a singleton class c++?

0 Answers  


Does c++ have foreach?

0 Answers  


Categories