I'm struggling with the whole pointer concept at the moment. For example I have a piece of code for testing the first char of a command line arguement but I can't get it to work.
I have tried different ways but at the minute I have
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
char input = argv[1];
printf("\n\nInput : %s\n\n", input);
if(input[0]=="M")
{
printf("\nThis is a message\n");
}
else if(input[0] == "L")
{
printf("\nThis is a log-in\n");
}
else
{
printf("\n\nwe have no match\n\n");
}
}
Could someone try and explain to me where I'm going wrong? This version says :
Thanks!