I'm trying to use main() parameter vectors to get three options, it output all three results. why cannot it work?
#include <ctype.h>
#include <stdio.h>
void output_1(char *str);
void output_2(char *str);
void output_3(char *str);
int main(int argc,char *argv[])
{
char str[40];
gets(str);
if (argv[1]="-p")
{
output_1(str);
}
if (argv[1]="-u")
{
output_2(str);
}
if (argv[1]="-l")
{
output_3(str);
}
}
the definations of output_1/2/3 don't matter.