I'm trying to make a parser. I have a version working with just pointers but I want to know how to convert it from pointers (char *p) to c strings (char p[]) to get more familiar with how they work.
I have a function...
int makearg(char s[], char**args[])
{
char *arg1
char arg2[50];
//I'm aware these don't assign the args pointer value to arg2.
arg2[0] = args[0];
//And I'm aware this does.
arg1 = (*args)[0]);
}
My question is what is the equivalent. Or maybe a brief explanation on what's going on. Other solutions just give working code without really saying how it works.
I don't think this is related by my mem allocation is using the pointer and []. And that works fine. Little unsure how that works also if anyone has time.
(*args)[i] = (char*) malloc(sizeof(char) * tokenLen);