Yes, that part is the easy part.neuraleskimo wrote:Correct. Your main function could be something like this.PsySc0rpi0n wrote:The function of appending the nodes to the list needs some guidance so that I can understand it. I mean, I understand the code, what I might not see straight forward is the reasoning behind the checks and the way the code is the way it is. I think I need a fully functional and minimal code to print out some memory addresses to see if I can understand what is going on. Or maybe what I really want to see is the code "avoiding" the potential problems, such has that initial dummy node, etc.
So, to make that happen, I think I only need to write the main() function, compile, run and add some strings to see the code working, no? Or is any other critical function/step yet missing?You can instrument the functions with print statements.Code: Select all
Blockchain* chain = createBlockChain(); chain = appendToChain(chain, "some string");
But how you connect the list (container) and the nodes (blocks) ? For instance, can you access a node's data using the container variable?