how is returning structurs from functions?Show an eg?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the order in which the objects in an array are destructed?

865


How do I tokenize a string in c++?

614


What is encapsulation in c++ with example?

593


What do you mean by persistent and non persistent objects?

742


Define macro.

597






Explain the static storage classes in c++.

709


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

556


What information can an exception contain?

671


Write is a binary search tree? Write an algo and tell complexity?

599


Differentiate between C and C++.

717


Is c++ the hardest programming language?

646


What is else syntax in c++?

645


Explain the uses oof nested class?

631


How static variables and local variablesare similar and dissimilar?

571


Do inline functions improve performance?

653