Trying to write a program that sorts names using an algorithm. I can not get the initial array to print properly, I feel like it's something simple that I'm missing. Sorry if I butchered it worse messing with the syntax.
Code:#include <stdio.h> #include <stdlib.h> #include <math.h> void print_array(char [], int); int main(int argc, char * argv[]){ print_array(* argv, (argc-1)); getchar(); return 0; } void print_array( char word[], int size){ int i = 0; for( i = 0; i < size; i++){ if(i < (size - 1)){ printf("%c", word[i]); }else{ printf("%c\n", word[i]); } } }



1Likes
LinkBack URL
About LinkBacks


