I've been stuck on this part for quite some time now. Could someone please point me in the direction of how to search through agrv[1] so that i can change the numbers into a letter? Thanks in advance.
or you can go C on it:
int len = strlen(argv[1]);
for(x = 0; x < len; x++)
{
do things here, probably best to just copy the stuff you want into a new string or c-string based off these inputs.
if (s[x] == 1)
result[x] = 'a'; //example...
}
line 24 if (array[i] = 2) I guess you mean if (array[i] == 2)
For the conversion it would be better to use a lookup table - much easier then long if or switch statements
1 2 3 4 5 6 7 8 9 10 11 12
char replace_table[] = "aeiou ";
// ...
int len = strlen(argv[1]);
for (int i = 0; i < len; i++)
{
int num = argv[1][i] - '0'; // convert char to an int
if (num >= 1 && num <= 6)
{
argv[1][i] = replace_table[num - 1];
}
// else leave orig char
}