Can anyone explain why I am getting segmentation fault in the following example?
#include #include int main(void) { char
I think it might be the char *tokens[50]; because you are declaring it a pointer when it is already a pointer. An array is already a pointer upon declaration. You mean to say char tokens[50];. That should do the trick.
char *tokens[50];
char tokens[50];