Ok, I am working on this bit of code to parse one line of user input into multiple variables. Ive tried strtok but kept getting awful memory errors in the end, so Ive started from scratch again. Ive included my entire main() just so you can get an idea of what i am doing with the variables once I can input and seperate them. I want to check first and foremost if both are in fact assigned, if not, I only care about the first one being assigned. If neither are assigned i loop the prompt again. Im also checking to make sure the length of each is no greater than 4. I have made a helper function strlen() that returns the length of of a char*. It is important that no matter how the input is processed that the variables cmd1 and cmd2 end up as char* since all fof my other functions rely on that. Can anyone point me in the right direction with this?

Code:
int main( void )
{
	int exit = 0;
	char  *cmd1, *cmd2;
	
	ht *symTable[SLOTS];
	for (int i=0; i<SLOTS; i++) symTable[i] = NULL;
	
	while (exit != 1) //Dump into while loop.
	{
		cout << "\nCMD>";

		/*	Takes input in the either one or two word commands:
			
			Ex.	CMD>type char
				or
				CMD>char abc
				or 
				CMD>show
				or 
				CMD>quit
				etc... and puts each keyword into a seperate char* cmd1 and/or cmd2 respectively
		*/
		
		if (strlen(cmd1) > 4) //Case 1
		{
			cout << "illegal identifier: '" << cmd1 << "'\n\n";
		}
		else if (strlen(cmd2) > 4) //Case 2
		{
			cout << "illegal identifier: '" << cmd2 << "'\n\n";
		}
		else if (cmd2 == NULL) //Case 3
		{
			if (cmd1 == "show") hashPrintTable(symTable);
			else if (cmd1 == "quit") exit = 1;
			else hashPrintEntry(symTable[h(cmd1)], cmd1);
		}
		else if (cmd1 == "type") //Case 4
		{
			hashInsert(symTable, cmd1, "type");
		}
		else //Case 5
		{
			if (hashType(symTable[h(cmd1)], cmd1) == 1)
			{
				hashInsert(symTable, cmd2, cmd1);
			}
			else cout << "type " << "'" << cmd1 << "' not declared\n\n";
		}
		
	}

	return 0;
}