Cmd* GetCommand() {
Cmd* command;
char* cmdStr = getIn();
command = parseL(cmdStr);
return command;
}
Cmd** parseL(char* str){
Cmd** command;
char* token;
char str2[CMD_MAX_LINE_LENGTH];
strcpy(str2, str);
token = strtok(str2, DELI);
command = ParC(token);
return command;
}
Cmd* parC(char* cmdStr) {
Cmd* command = calloc(1, sizeof(CmdCommand));
if (cmdStr == NULL) {
command->cmd = INVALID;
return command;
}
else
parse2C(cmdStr, command);
return command;
}
Hey, I'm new to C and got a problem in my code.
When I'm running this part of code I get an error:
assignment makes pointer from integer without a cast.
for this line:
command = parseL(cmdStr);
command
is from type Cmd*
and also the function parseL
returns Cmd*
, so I can't find out the problem.