Mercurial > hg > CbC > CbC_examples
view test_array.c @ 2:35d6eabeadb0
modify Makefile. we can use makefile to compile outside CbC examples. (some examples are not compilable...)
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Oct 2014 02:06:29 +0900 |
parents | bacef8675607 |
children |
line wrap: on
line source
#include<stdio.h> void print_array(int *, int); int main(int argc, char **argv){ int array[10] = {10, 2, 3, 0, 7, 5}; array[1] += array[2]+array[4]; print_array(array, 10); return 0; } void print_array(int *a, int size){ while( size-->0 ){ printf(" %7d", *a++); } printf("\n"); }