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 can virtual functions in c++ be implemented?

0 Answers  


What are advantages of c++?

0 Answers  


Is there any problem with the following: char *a=NULL; char& p = *a;?

1 Answers  


Write about the stack unwinding?

0 Answers  


If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?

0 Answers  






How many pointers are required to reverse a link list?

5 Answers   CTS,


What is the benefit of encapsulation?

0 Answers  


What are Virtual Functions? How to implement virtual functions in "C" ?

3 Answers  


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

0 Answers  


Explain storage qualifiers in c++.

0 Answers  


Are iterators pointers?

0 Answers  


What is stream and its types in c++?

0 Answers  


Categories