Jim's Matrix - a C programming example I encourage you to use this model as a template. There are other approaches to programming in C, but the approach here has worked well for me. Jim Mahoney | Jan 2016 | MIT License Features * one executable (test) from multiple C files * a C structure and its associated methods * memory allocation on the heap * a custom make file to compile it Files readme.txt this overview jims_matrix.h header file, i.e. interface declarations jims_matrix.c code implementing matrix functions test.c main program that tests the jims_matrix library Makefile compilation recipe Compiling it $ gcc -c test.c -o test.o # compile test.c to test.o object $ gcc -c jims_matrix.c -o jims_matrix.o # compile jims_matrix.c $ gcc test.o jims_matrix.o -o test # link 'em to make executable or just use the Makefile to do it for you $ make Running it $ ./test testing jims_matrix stuff The original matrix : 1.00 2.00 3.00 0.00 0.50 0.80 20.00 25.00 35.50 The transposed matrix : 1.00 0.00 20.00 2.00 0.50 25.00 3.00 0.80 35.50 So there.