view test_array.c @ 20:c181f93d4e30

minor fix
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Mon, 25 Jan 2016 09:53:21 +0900
parents 35d6eabeadb0
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");
}