From 0bf28391b00b1e28c44324bcd7647df416314667 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 25 Mar 2010 06:29:54 -0400 Subject: lots and lots of vim stuff for c development... --- .../codesnippets/print_double_array.c.noindent | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .vim/c-support/codesnippets/print_double_array.c.noindent (limited to '.vim/c-support/codesnippets/print_double_array.c.noindent') diff --git a/.vim/c-support/codesnippets/print_double_array.c.noindent b/.vim/c-support/codesnippets/print_double_array.c.noindent new file mode 100644 index 0000000..c6bea02 --- /dev/null +++ b/.vim/c-support/codesnippets/print_double_array.c.noindent @@ -0,0 +1,34 @@ + +/* + * === FUNCTION ====================================================================== + * Name: print_double_array + * Description: Print a double-array with one dimension. + * Use + * print_int_array( *matrix, n1*n2, n2, "matrix" ); + * for + * double matrix[n1][n2]; + * ===================================================================================== + */ +static void +print_double_array ( double array[], /* array to print */ + int n, /* number of elements to print */ + int nrow, /* number of elements per row */ + char *arrayname /* array name */ + ) +{ + int i; + printf ("\n\n array \"%s\", length %d\n", arrayname, n ); + printf ("\n index | content\n" ); + printf ( " ------+-" ); + for ( i = 0; i < nrow; i += 1 ) + printf ( "---------" ); + for ( i=0; i