File: foo.cc

package info (click to toggle)
ecbuild 3.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,068 kB
  • sloc: sh: 1,404; perl: 732; f90: 472; cpp: 466; python: 383; ansic: 304; fortran: 43; makefile: 15
file content (48 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (5)
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
#include <iostream>

using namespace std;

  extern "C"
  {
      void ir2_(int*,int *);
      int  if3_(int *);

      void    dr2_(double*,double *);
      double  df3_(double *);

      void lir2_(int*,int *);
      int  lif3_(int *);

      void    ldr2_(double*,double *);
      double  ldf3_(double *);
  }

  int main()
  {
      cout << "INT" << endl;

      int n = 10;
      int n2 = 0;
      int n3 = 0;

      ir2_(&n,&n2);
      cout << n << "^2 = " << n2 << endl;

      n3 = if3_(&n);
      cout << n << "^3 = " << n3 << endl;

      cout << "DOUBLE" << endl;

      double d  = 4.4;
      double d2 = 0;
      double d3 = 0;

      dr2_(&d,&d2);
      cout << d << "^2 = " << d2 << endl;

      d3 = df3_(&d);
      cout << d << "^3 = " << d3 << endl;

      return 0;
  }