File: bug3561Dll.cpp

package info (click to toggle)
scilab 5.3.3-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 330,656 kB
file content (51 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// MathFuncsDll.cpp

#pragma managed(push, off)
#include <iostream>
//#include <math.h>
//#include "string.h"


#include "bug3561Dll.h"



DllExport void Add(double *a, double *b, double *c)
    {
        *c = *a + *b;
    }

DllExport void Subtract(double *a, double *b, double *c)
    {

		*c = *a - *b;
    }

DllExport void Multiply(double *a, double *b, double *c)
    {
		
		*c = *a * *b;
    }

DllExport void Divide(double *a, double *b, double *c)
    {
        if (b == 0)
        {
			std::cout<< "invalid_argument b cannot be zero!";
        }
		else{
		
			*c = *a / *b;
		}
}

DllExport void WriteString(char * c)
    {
		
		c[0] = '1';
		c[1] = '2';
		c[2] = '3';
		c[3] = '4';
		c[4] = '5';
		c[5] = 0;
    }