Hi, I was studying hash functions and I wrote this code for applying what I learned but it's giving me a segmentation fault while assigning the new node to the table. I'm such a beginner and didn't manage to find a solution.
I added a statement if a node is null assign an init node to it and it worked like a charm.
This sounds to me like you might be creating unnecessary nodes (with garbage data values?). There is no need for that. You only need one node per "key". No more nodes than that.
Talking about unnecessary nodes, you don't need to create a new node on line 26. It's never used for anything, and it's never destroyed, so it's just a memory leak.
Note that a node (object) is never null. It is the Node* (node pointers) that might be null.
You're 100% right, I used an unnecessary node because I wanted to see if the first nodes are empty.
You're right about line 26.
And thanks for the last sentence, it really enlighted me.
Also, my Malwarebytes blocked your website.
Also, should I start with SDL or SFML, or unreal engine? I want to go a little beyond with c++ but I can't decide what to do. Or should I try some Qt or VC++?
You're 100% right, I used an unnecessary node because I wanted to see if the first nodes are empty.
Again, nodes are never empty/null (unless you use a special data value to express that a node is "empty" but that probably just complicate things for no good reason).
What you have is essentially 10 singly linked lists.
If a list is empty the "head" pointer (in the std::vector) will be null.
Also, my Malwarebytes blocked your website.
Does it say why? I don't think my website contains any "malware" but if it does then I would like to know.
If it's a "false positive" and it's just blocking it because it doesn't trust it, perhaps because it contains .exe files that you can download, then I don't think there is much I can do.
Also, should I start with SDL or SFML, or unreal engine?
I'm a big fan of free software so if you ask me I would recommend SDL or SFML over Unreal Engine, but I don't decide over you, it's your decision.
Personally I have more experience with SDL. I think it's great but SFML also seems good and it might be easier especially if you're not familiar with C.
SFML is a C++ library. SDL is a C library but you can of course use it in C++. That's what I do.
SFML seems to have a bit better official tutorials and documentation than SDL.
I think your site doesn't have this HTTPS certificate. That's why chrome says the site is not secure too.
Thanks for these and I think I'll continue with SFML. But last summer I started to watch a tutorial about how to use SFML, it was too complicated for me. Also, I looked at some simple games like making tic tac toe clone on SFML but same it was complicated for me.
they are different things. The window frameworks are for 'dialogs' or 'windows' and user-interface. There is overlap, and those tools can play a video or display an image or even allow you to directly draw into a window and do crude graphics or very simple games, so sure, for tic-tac-toe you can certainly do just that and its fine. But these are not high end gaming tools, so at some point their limitations for graphics will cause you to want to go back to a dedicated 3d gaming library.
I think your site doesn't have this HTTPS certificate. That's why chrome says the site is not secure too.
It's available with both HTTP and HTTPS.
For some reason this website does not allow the profile website URL to start with https://
cplusplus dot com wrote:
There were errors while processing your submission. Please correct them and submit again.
Please, use only the http:// scheme prefix for your website's url