I'm new to C and I'm fighting with pointers and argv's right now... I wrote:
#include <stdio.h>
#include <stdlib.h>
void main(int argc,char *argv[]){
while(*argv){
printf("%s",*argv);
if(*argv == "show"){
printf("Great");
}
*argv++;
}
}
and the script should show "great" if it will be started with ./myscript show
What's wrong there?


Sign In
Create Account

Back to top









