Actually I realised that I still need to use the switch statement because the pointer does not know which opcode to perform (as you said).
The thing that there's alot of cases in my code (lots of if-else or cases in the switch block), and I'm trying to find a clever approach to reduce the code...
Let's consider the following piece of code:
float Plus (float a, float b) { return a+b; }
float Minus (float a, float b) { return a-b; }
float Multiply(float a, float b) { return a*b; }
float Divide (float a, float b) { return a/b; }
// Solution with a switch-statement - <opCode>...
Hi all,
Can anyone give me a hint how can I replace a switch statement with a delegate? I'm using .net here and as I know there is no function pointers in the .net framework.
Any help would be appreciated.
Thanks.
Hello everyone,
I'm trying to create an Xml file using VS.Net, but the problem when I validate the Xml document it always gives me this error: Invalid at the top of the document.
Error code:- 10721896683...
Any help would be appreciated.
Thanks
Hello,
I want to serialize the object TreeNode, but it always throw this exeption:
{"There was an error reflecting property 'ContextMenu'."} - this is the inne
r exeption.
I'm using the XMLSerializer to serialize the treeNode into a XML file.
How can this problem be solved?
Hello everyone,
I have a schema and I wish to navigate through it, when I have a complex type, I can get the sequence element in that complex type by: complextype.particle, but it's still treated as a particle and i can't get the elements inside it.
How can I get the sequence element in that...
Yes I'm trying to put the content of the file in the database. So I have to change the Fileinfo to a Binary Object (Sql Data type)...
Thanx for the help
Hello,
I have files objects of type: FileInfo, and I need to change them to a Binary Object format so I can put them in a database...
How can that be done please?
Thank you
Ok I have SQL Server 2000.
I have files objects of type: FileInfo and I want to change (convert) the files to a binary objects...
How can that be done please??
Thank you
Hello,
How can I fill a database with files (like mp3s or .jpeg)??
The thing that the database only support specific data types and it cant be filled by anything else...
Thank u
How can I assign the "return" key to a specific button in the form? Im making a search engine and I want to press "enter" to make the search instead of clicking the search button...
Thank you
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.