-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppwrite.cc
More file actions
54 lines (44 loc) · 1.04 KB
/
cppwrite.cc
File metadata and controls
54 lines (44 loc) · 1.04 KB
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
52
53
54
#include "testmod.h"
#include <cstring>
#include <iomanip>
#include <iostream>
extern "C" {
void cppwrite() {
auto myinst1 = FortMod::testtype1IF::copy();
auto myinst2 = FortMod::testtype2IF::copy();
myinst1.fbool = false;
myinst1.ffloat = 8.7654321;
myinst1.fdouble = 6.543210987654321;
myinst1.set_fstr("A slightly longer string from C++");
int ctr = 1;
for (int i = 0; i < 5; ++i) {
myinst2.ffloata[i] = ctr--;
}
ctr = 10;
for (int i = 0; i < intpar; ++i) {
myinst2.ffloatapar[i] = ctr--;
}
ctr = 100;
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 3; ++j) {
myinst2.ffloat2a[i][j] = ctr--;
}
}
ctr = 1000;
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < intpar; ++j) {
myinst2.ffloat2apar[i][j] = ctr--;
}
}
ctr = 10000;
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 3; ++j) {
for (int k = 0; k < 2; ++k) {
myinst2.fint3dim[i][j][k] = ctr--;
}
}
}
FortMod::testtype1IF::update(myinst1);
FortMod::testtype2IF::update(myinst2);
}
}