How can I call a function, given its name as a string?

Answer Posted / hemant ware

A function can be called by object name and a function
name (sring ) with dot(.) operator.
e.g
class hi
{
void string()
{
cout<<"hello I am in string function";
}
};
void main()
{
hi h1;
h1.string();
}

Is This Answer Correct ?    12 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is enumerated data type in c?

629


what is the height of tree if leaf node is at level 3. please explain

1603


Explain what is the difference between functions getch() and getche()?

609


Explain how do you print an address?

660


What is queue in c?

579






What are the types of data files?

730


What is substring in c?

642


What is openmp in c?

613


What is the explanation for prototype function in c?

572


What is the difference between far and near ?

688


What is the size of structure pointer in c?

614


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

659


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

682


How do you construct an increment statement or decrement statement in C?

746


What is the purpose of the statement: strcat (S2, S1)?

642