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 |
what does data structure mean?
What is the difference between text files and binary files?
Explain what are binary trees?
What is the most efficient way to store flag values?
Blade logic interview question. 1st round is a written tests with 15 multiple questions from c and c++. All are simple basic question. Like int main () { Int i=65; Return printf(ā%cā, i); } 2nd and 3rd round is technical interview. The position for which I was interview was core UNIX and c. Yes it is for system programming. The company has product name blade server. For their server they are creating their own command for their purpose. Example cd command. We can implement it in a c program by using the chdir() function. So the question asks related to PID, fork, pipe, shared memory, signal. Write a program in c which will act as cp command.
1 Answers BladeLogic, Infosys,
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
In C language, a variable name cannot contain?
What is the collection of communication lines and routers called?
Is that possible to store 32768 in an int data type variable?
What does volatile do?
How arrays can be passed to a user defined function
Can we declare variable anywhere in c?