![]() ![]() ![]() SGraph(size_t nodes): nodes(nodes), pmatrix(nodes * nodes) It's somewhat similar to a const pointer, except the fact that a pointer of that type can hold a NULL. Also I've understand what a reference and were to use it. OK, I've analyzed your answers (thanks all), and I've rewritten the code in a more OOP manner. Is there a standard alternative for vector and type** for bi dimensional arrays in C++ ? Is my current programming style, compatible with the constructs of C++ ? Here is the code (probably isn't Cppthonic as it should): #include Ĭan you please can give me some hints on how to use references, by referencing to this code ? Every time I need a reference, I get confused and I think in terms of pointers. ![]() Unfortunately I can't quite grasp the concept of reference. Still from what I read it's best to pass parameters by references in C++. I've come to this code, its a DFS - Depth First Search in an unoriented graph. In order to learn a new language I ussualy start by re-implementing different classical algorithms, as language specific as I can. I've recently (4 days) started to learn C++ coming from C / Java background. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |