mercredi 11 novembre 2020

Segmentation fault as soon as function is called

Code parses through a text file set in the command prompt line, then pushes each space-separated token into a string vector, then calls a function called Traducao, passing the vector as an argument. I then get a segmentation fault.

else if(ConverteArrayString(argv[1],strlen(argv[1])) == "-o"){
        vector<string> teste;
        while(!ARQ.eof()){
            getline(ARQ,ancoraLine);
            istringstream iss(ancoraLine);
            for(string s; iss>>s;){
                teste.push_back(s);
            }
            teste.push_back("\n");
        }
        vector<string> resultado = Traducao(teste);

Aucun commentaire:

Enregistrer un commentaire