this is my code
int main(int argc, char **argv)
{
pid_t child = fork();
char * argument = argv[1];
if (child < 0)
{
perror("fork");
}
else if (child == 0)
{
if (argument == "What")
{
write(STDOUT_FILENO, "Yes i did it", 11);
}
else
{
write(STDOUT_FILENO, "Something went wrong...", 23);
}
exit(0);
}
else
{
}
return 0;
}
every time i run it with gcc example.c -o name
then run it with ./name What
but every time on the console is written Something went wrong...
.
how could i gain access to my first command line argument.