source: CIVL/mods/dev.civl.abc/examples/fortran/commonblock/test.c

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 456 bytes
Line 
1union __FCB__CB_MC {
2 struct __FCB__PROG_MAIN_CB_MC {
3 float R;
4 int A;
5 float F;
6 } prog_main;
7
8 struct __FCB__SUBR_SUB_CB_MC {
9 float A;
10 int I;
11 float B;
12 } subr_sub;
13} comm_blk_mc;
14
15void sub(float P, float Q) {
16 comm_blk_mc.subr_sub.B = comm_blk_mc.subr_sub.I + 2*comm_blk_mc.subr_sub.A;
17}
18
19void main () {
20 float X, Y;
21 comm_blk_mc.prog_main.A = 5;
22 comm_blk_mc.prog_main.R = 3.5;
23 sub(X, Y);
24 printf("%d", comm_blk_mc.F);
25}
Note: See TracBrowser for help on using the repository browser.