mirror of
https://github.com/guilhermewerner/rust-ffi
synced 2025-06-16 05:44:19 +00:00
Add String Conversion Function
This commit is contained in:
@ -11,6 +11,9 @@ namespace CSharp
|
||||
const string Library = "libLibrary";
|
||||
#endif
|
||||
|
||||
[DllImport(Library)]
|
||||
static extern string Hello(string input);
|
||||
|
||||
[DllImport(Library)]
|
||||
static extern float Add(float Num1, float Num2);
|
||||
|
||||
@ -25,6 +28,14 @@ namespace CSharp
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// Hello
|
||||
|
||||
string result = Hello("C#");
|
||||
|
||||
Console.WriteLine(result);
|
||||
|
||||
// Operations
|
||||
|
||||
int num1 = 1;
|
||||
int num2 = 2;
|
||||
|
||||
|
Reference in New Issue
Block a user