source:
CIVL/mods/dev.civl.com/examples/experimental/out2.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 376 bytes | |
| Line | |
|---|---|
| 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("output2.out","a+"); |
| 13 | int b[5]; |
| 14 | |
| 15 | for(int i=0;i<5;i++) { |
| 16 | b[i] = i+1; |
| 17 | } |
| 18 | #ifdef _CIVL |
| 19 | for(int i=0; i<5; i++) { |
| 20 | array[i] = b[i]; |
| 21 | } |
| 22 | #else |
| 23 | for(int i=0; i<5; i++) { |
| 24 | fprintf(fpt,"%d\n",b[i]); |
| 25 | } |
| 26 | #endif |
| 27 | fclose(fpt); |
| 28 | } |
| 29 | |
| 30 |
Note:
See TracBrowser
for help on using the repository browser.
