answersLogoWhite

0


Best Answer

we have to construct a table of two field structures,where the first field is the funtion name as a string and the second field is just the function name.then search the table to get a string match in the first field and use the second field to call the function.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you call a function given its name as a string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How are the strings passed to a function?

By reference. The name of the string is converted to a pointer (in C/C++) and given to the function as the address of the first element. (In Java, all objects are passed by reference, and there are no pointers.)


How do you use MID function in qbasic?

...QBASIC program code... name$="Jack" startCharPos%=2 howManyChars%=2 PRINT MID$(name$,startCharPos%,howManyChars%) ...output... ac EXPLANATION The MID$() function allows you to select characters from out of a string. In the above case the string is,... name$="Jack" ...where... J= string position 1 a= string position 2 c= string position 3 k= string position 4 ...thus, if we select MID$(name$,2,2)... ...this code is actually saying...select from the name...the character which begins at position 2 = a/and, extract 2 characters going along from there... = ac.


What is the simularities of parameter and arguments?

Arguments are fields that are given to a method when it is called, while parameters are the name for the received variables. For example:public static void main(String[] args){int arg1 = 0;boolean arg2 = false;String arg3 = "Some string";function_a(arg1, arg2, arg3);// These variables are called arguments because they are being passed// to the function.}public static void function_a(int par1, boolean par2, String par3){// These variables are called parameters because they are being received// when the function is called.}I hope this helps.


How do you use bsearch function to search a name sorted in array of pointers to string?

solution of above question on (link moved to link section)


What does mangle mean?

Function mangling is a process where some languages, notably C, alter the function's link symbol in order to create unique names for functions with the same name but different parameters. The linker can then distinguish between which function to call by comparing the object code's mangled function calls to the call table. As a simple example, given a function such as int foo(int bar), the function might become managed as _foo@4. Then, when the C compiler finds a call such as foo(4), it will generate a linker call such as "push 4; call _foo@4;".

Related questions

How are the strings passed to a function?

By reference. The name of the string is converted to a pointer (in C/C++) and given to the function as the address of the first element. (In Java, all objects are passed by reference, and there are no pointers.)


What is the name given to the highest sounding string instrument?

The violin is the highest pitched string instrument.


What is the name given to a 4 string guitar?

A bass guitar.


How do you take substring from a given string in php?

Use the substr function. For example <?php $name= "naruto uzumaki"; echo substr($name, 0, 6) ; // The first six char are taken by this code ?> This will output naruto


How do you concatenate a string?

v can concatenate two string by using a function like: select CONCAT( CONCAT('ename','e_mrks'),"name","marks" from student;


Why do the people of Umuofia call a snake a string and not a snake at night?

They do not call a snake by name because they are afraid it will hear it's name and respond.


What name is given to the shape of a quadratic function?

A parabola


How do you use MID function in qbasic?

...QBASIC program code... name$="Jack" startCharPos%=2 howManyChars%=2 PRINT MID$(name$,startCharPos%,howManyChars%) ...output... ac EXPLANATION The MID$() function allows you to select characters from out of a string. In the above case the string is,... name$="Jack" ...where... J= string position 1 a= string position 2 c= string position 3 k= string position 4 ...thus, if we select MID$(name$,2,2)... ...this code is actually saying...select from the name...the character which begins at position 2 = a/and, extract 2 characters going along from there... = ac.


What is the function of an atlas?

An atlas is the name given to a book of maps.


What does the string of pearls refer to?

The String of Pearls is a reference to the Chinese military and it's commercial facilities. The name is given to the relationship it holds among the sea lines of communication.


What name is given to lines of longitude?

they call parells


What is the simularities of parameter and arguments?

Arguments are fields that are given to a method when it is called, while parameters are the name for the received variables. For example:public static void main(String[] args){int arg1 = 0;boolean arg2 = false;String arg3 = "Some string";function_a(arg1, arg2, arg3);// These variables are called arguments because they are being passed// to the function.}public static void function_a(int par1, boolean par2, String par3){// These variables are called parameters because they are being received// when the function is called.}I hope this helps.