source:
CIVL/mods/dev.civl.com/examples/experimental/out1.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 345 bytes | |
| Rev | Line | |
|---|---|---|
| [bac8a18] | 1 | #ifdef _CIVL |
| 2 | #include <civlc.cvh> | |
| 3 | #endif | |
| 4 | ||
| 5 | #include<stdio.h> | |
| 6 | ||
| 7 | #ifdef _CIVL | |
| 8 | $output int array[20]; | |
| 9 | #endif | |
| 10 | ||
| 11 | int main() { | |
| 12 | FILE *fpt = fopen("output1.out","a+"); | |
| 13 | int a[5]={1,2,3,4,5}; | |
| 14 | ||
| 15 | #ifdef _CIVL | |
| 16 | for(int i=0; i<5; i++) { | |
| 17 | array[i] = a[i]; | |
| 18 | } | |
| 19 | #else | |
| 20 | for(int i=0; i<5; i++) { | |
| 21 | fprintf(fpt,"%d\n",a[i]); | |
| 22 | } | |
| 23 | #endif | |
| 24 | fclose(fpt); | |
| 25 | } | |
| 26 | ||
| 27 |
Note:
See TracBrowser
for help on using the repository browser.
