-
Calculator on C#
Hey!
I have a calculator with buttons, and when I click the numbers or operators, it goes to a string array. So;
Press 3
Press +
Press 2
Press =
and my array is str[0]='3' str[1]=.... so on...
And also I have a C code which calculates the string you entered with some algorhytms and gives a double value as a result. So the question is;
How can I send my STR array in C# to my C program? I mean I want to use my C program as a source code. and How to return that double value to my C# program?
For now, I don't want to change my C codes into C# codes. I want it to keep as is. Just use it as a source code. Is that possible?
Thanks in advance
-
You use P/Invoke ( Platform Invoke Tutorial (C#) ) to communicate with unmanaged libraries from C#. I have to say though, using P/Invoke to perform such a very simple task as calculating a character array of digits and operators seems bizarre.
-
I think he's talking about spawning the C program and sending it the string as command line parameters. is this correct?