multiple linked lists inheritance

deleted
Last edited on
Are you using include guards for your header file?
Sorry, English is not my first language, could you explain?
Last edited on
Yes, so in your header file (.h) file, are you using the following statements?
1
2
3
4
5
6
#ifndef NAME_OF_THE_FILE
#define NAME_OF_THE_FILE

//...

#endif 
From what I can tell, there's nothing syntactically wrong with your code. It must be a problem in your main() function or in another source file that includes the definitions of your classes. Please post all of your code here so that we can see what is going on
Oh ok, yes I am.
Could you please post the rest of your code? Your main function, other source files, etc?
Ok, one moment
cant post entire code here, can a share my gdrive with the code?
Sure, whatever works. Just post the code that is giving you the error.
here it goes:deleted
Last edited on
I requested access for the file. It should have sent you an email.
should work now
I don't see any files in the folder.
Strange, I'll send them to you via mail
have you received the files?
Yes. The first problem I see is that you call "novoItemVendas" in metodos.cpp as if it were a regular function. It is a member function in a completely different class. You need a lista_itens_vendas object in order to access it, but you call it from lista_produto.

I assume this is also the problem for escolheProduto, devolveCustodaVenda, and devolvePreco

Also, you redefine multiple functions (i.e, you have more than one definition of them in the source file) which is why the compiler is complaining.
Last edited on
How can I fix it?

i've already fixed the multiple redefinition , probably happened because i originally had made the methods in the header the copy and pasted to the new file
Last edited on
To fix it, you would need to pass in an object of type lista_itens_vendas (lets assume you call it my_object) into the function that calls novoItemVenda (or the other methods). You can then use this object with the dot (.) operator to access novoItemVenda, like this:

 
my_object.novoItemVenda(/*...*/);
Last edited on
Thank you very much, I'm able to run the program now, just need to fix so small incoherences :)
Topic archived. No new replies allowed.