Quote:Original post by programering
You know the things about why you have definitions right?
Class definitions? Yes.
Definitions in the sense that you seem to be talking about them? Not really - enlighten us.
It's not clear what you're trying to achieve here.
I think the problem is you're not really using terminology particularly well and it's somewhat confusing.
Quote:With vectors and then I can have it in class'es.
So I don't know if I should have the object definitions as struct's or if everything
in pure C++ shall be classes.
You can have vectors in structs, you can have methods too. You seem to think that structs are somehow not 'pure' C++? They're part of the language for sure.
Quote:When should one use struct's or classes?
It's purely stylistic. Most people are accustomed to reading class, however some people (like myself) may use structs for POD types.
Quote:When should one use std::vector's or dynamic arrays?
This is an example of poor terminology usage, a std::vector is practically always a dynamic array implementation. We assume that when you say 'dynamic array' you mean using new[] and delete[]. The answer is use std::vector always [smile]
Quote:And one more thing should I have the constructor/function parameters char *pointer, std::string or std::string& reference.
Prefere to pass strings by a constant reference, so that's: const std::string&
Quote:How is the most valid C++ coding manner way of doing it?
No such thing as 'most valid', they're all equally just as valid, some ways are just better practice.
If style is viciously impeding on getting things done then most programmers tend to opt for what works first and foremost; then they worry about how to make it better.