jeudi 28 février 2019

function is ignoring if/else as if it doesnt exist

I have been trying for awhile and i couldn't get it to work so i decided to come here to ask.

#include <stdio.h>
char CMD[255];
int main ()
{
    fgets (CMD, 255, stdin);
    exi("hello", printf ("hello\n"));
}
int exi (char INPUT[255], char PROG[255])
{
    if (strcpy(INPUT,PROG)==0){
        PROG;
    }
    else{
        system(CMD);
    }
}

Code within "ext()" If and else is ignored completely and i have no idea why. any help will be appreciated.

Aucun commentaire:

Enregistrer un commentaire