Example #1
0
void uniterm_laco_principal() {

	while (true) {
		char comando[TAMANHO_COMANDO], parametros[TAMANHO_PARAMETROS];

		digitar_prompt();
		ler_comando(comando, parametros);
		executar_comando(comando, parametros);
	}
}
Example #2
0
int main () {

	ABB arv;

    std::string line;

    std::ifstream myfile ("arquivo_de_entrada_ABB.txt");

    //inserindo os elementos da arvore

    //system("clear");


    if (myfile.is_open()) {
        while (getline (myfile,line)) {
            iniciarABB(line, arv);
        }

        myfile.close();
    }

    else 
    	std::cout << "Unable to open file" << std::endl;

     /*
     std::cout << arv.toString() << std::endl;
     if (arv.ehCheia()) {
     	 std::cout << "eh cheia" << std::endl;
     }
     */


    //entrada de comandos pelo arquivo
    myfile.open("arquivo_de_comando.txt");

    if (myfile.is_open())
    {
        while (getline (myfile,line))
        {
            ler_comando(line, arv);
        }

        myfile.close();
    }
    else
		std::cout << "Unable to open file" << std::endl;
     

    return 0;
}