First, you're a bit inconsistent in when and how you use argc or argc-1 and argv or argv+1 (or, you were in your last complete post, #14). Pick one method and stick to it. I recommend your...
Type: Posts; User: anduril462
First, you're a bit inconsistent in when and how you use argc or argc-1 and argv or argv+1 (or, you were in your last complete post, #14). Pick one method and stick to it. I recommend your...
Okay, so you need to sort the elements of argv. argv is essentially an array of char pointers, so you are just sorting an array of char pointers. You need something like this:
void sort(char...
Are you trying to sort each word in argv?
If so, then you need to pass the entire word. For example:
void sort(char *word, int len)
{
char tmp;
// sorting algorithm loops and such...
Ahh, I get what you're after. Just make the argc and argv parameters in the other function look like the ones in main, then pass argc and argv from main to that function, no need for any extra *,...
argv is an array of pointers to char*, thus, *argv is just a pointer to char, it's equivalent to *(argv + 0) which is equivalent to argv[0]. So you are calling print_array with just the first...