How can I call a function, given its name as a string?
Answers were Sorted based on User's Feedback
Answer / alice
You can't. You have to construct a table of two-field
structures, where the first field is the function name as a
string, and the second field is just the function name
(which the compiler will convert to its calling address).
Then search the table to get a string match in the first
field, and use the second field to call the function.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / ashay
Ashay here according to the programming scenario u cannot
give a function the name of a system defined identifier and
string is a system defined identifier and as aresult of
which u r unable to call
| Is This Answer Correct ? | 9 Yes | 8 No |
Answer / neeraj
#include<stdio.h>
#define string sum1()
int main(){
int k=string;
printf("%d",k);
getch();
return 0;
}
sum1()
{
int c=6;
int d=7;
return(c+d);
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / 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 |
Can you write a programmer for FACTORIAL using recursion?
Can you write the algorithm for Queue?
0 Answers College School Exams Tests, TCS,
who will call your main function in c under linux?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
wats SIZE_T meant for?
What is the difference between GETS();AND SCANF();
What's the difference between calloc() and malloc()?
How can you find out how much memory is available?
write a own function to compare two strings with out using stringcomparition function?
What are the types of data files?
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]
Explain what is output redirection?