Make a function return an implemented object c ++

0

I have a class created and that works correctly, in this case it is a Queue, with its attributes and functions. Now I want to create and invoke a function that returns an object of this type but throws me an exception. I have:

Cola trocear(char[] palabra){
    Cola cola1;
    //resto del codigo
    return cola1
}

main(){
    char palabra[]="hola";
    Cola c;
    c=trocear(palabra);
}

The lines of code are fine, the only thing that fails me is the moment to make the invocation

    
asked by hugoboss 04.11.2018 в 13:59
source

0 answers