well, I wanted to make the array I create more malleable, so I could run though it simply than using argv or something.
I'm not all that good at pointers...Does this work? It compiles okay..
Code:
#include <stdio.h>
#include <stdlib.h>
#define STR_LENGTH 50
int main(int argc, char *argv[])
{
char phraseOne[STR_LENGTH], phraseTwo[STR_LENGTH];
int i = 0, k = 0, counter1 = 0, counter2 = 0;
while(argv[1][i]!='\0')
{
phraseOne[i] = argv[1][i]; // Copy the content of the second array
i++;
counter1++;
}
while(argv[2][k]!='\0')
{
phraseTwo[k] = argv[2][k]; // Copy the content of the second array
k++;
counter2++;
}
return 0;
}
EDIT: changed for loops...made it stop when the main string is null..