|
Members in Shoutbox
None.
Shoutbox Search
Shoutbox Commands
/w [name] > Whisper
/r > Reply to last whisper /me > Marks as action Shoutbox Information
Moderators may delete any and all shouts at will.
|
Global Shoutbox
Please log in to shout.
[2014-10-24. : 3:58 am] poiuy_qwert -- I only created a temporary variable to store the pointer to the Table, that way I didn't have to dereference the table pointer every line. Makes it easier to read and is slightly more efficient[2014-10-24. : 3:55 am] Dem0n -- Why did you create an entirely new table? And what does Bucket** in malloc do?[2014-10-24. : 3:34 am] Dem0n -- That function is probably littered with errors. I have no clue what I'm doing.[2014-10-24. : 3:25 am] Dem0n -- poiuy_qwertpoiuy_qwert shouted: Dem0n Did you actually alloc a Table and assign it to *table? I did[2014-10-24. : 2:48 am] poiuy_qwert -- Dem0nDem0n shouted: welp, apparently *(*table)->buckets = (Bucket *) calloc(table_size, sizeof(Bucket*)) is wrong. gives me a segfault Did you actually alloc a Table and assign it to *table?![]() [2014-10-24. : 1:14 am] LoveLess -- Mini Moose 2707Mini Moose 2707 shouted: LoveLess Good, it seems that the ones you end up with knowingly tend not to work out too well. ![]() ![]() [2014-10-24. : 1:07 am] Moose -- LoveLessLoveLess shouted: Going on a blind date to this... Good, it seems that the ones you end up with knowingly tend not to work out too well. ![]() [2014-10-23. : 11:58 pm] Dem0n -- When I do that, it says, "error: assignment from incompatible pointer type"[2014-10-23. : 11:56 pm] Dem0n -- When I tried table/*table, it was saying it couldn't find buckets in the structure D:[2014-10-23. : 11:46 pm] Dem0n -- my memory checker thingy says there's a use of unitialized value of size 8 and invalid write of size 8 on that line[2014-10-23. : 11:46 pm] Dem0n -- welp, apparently *(*table)->buckets = (Bucket *) calloc(table_size, sizeof(Bucket*)) is wrong. gives me a segfault ![]() [2014-10-23. : 11:42 pm] Dem0n -- Does calloc allocate enough memory for each element, or enough memory for the entire array?[2014-10-23. : 11:40 pm] Dem0n -- If I have an array of pointers, what should the size of each element be? I don't ge tit[2014-10-23. : 11:26 pm] Zycorax -- RoyRoy shouted: Hey Zycorax, don't take this the wrong way, but your Steam profile strongly suggests you are afflicted by fiscal irresponsibility (buying games you do not play). This mentality scales out to your spending habits in general, and you're likely vulnerable to manipulative advertising. You should take a course in personal finance and educate yourself on psychology in marketing: it will protect your wallet, and you'll have a bunch of extra money for things you actually want/need. hah, I only really spend money on rent, food and games[2014-10-23. : 11:19 pm] Moose -- ** is an operator for exponentiation in some languagesm but I don't think that's what you're doing there. ![]() [2014-10-23. : 11:13 pm] Dem0n -- I also have no clue what the hell **buckets means. Is it a double pointer so that you can have a 2d array for chained hashing?[2014-10-23. : 11:05 pm] Dem0n -- I thought doing that would create an array of size table_size with each element allocating enough memory to fit a Bucket type[2014-10-23. : 11:04 pm] jjf28 -- sizeof(Bucket)? you're allocating an array of Bucket [b]pointers[/i], rethink your sizeof[2014-10-23. : 10:59 pm] Dem0n -- It says to initialize it to size table_size, so I did (*table)->buckets = (Bucket *) calloc(table_size, sizeof(Bucket))[2014-10-23. : 10:59 pm] Dem0n -- Can someone at least read that and just tell me how I'm supposed to initialize an array of Buckets lul[2014-10-23. : 10:59 pm] jjf28 -- but really I've only used arrays of pointers when it comes to strings (const char**)[2014-10-23. : 10:56 pm] Jack -- Usually a double pointer in a function argument is used to return pointers from a function. But you don't actually use return ptr;, instead you just modify the **ptr and it will affect the original pointer because you passed double pointers.[2014-10-23. : 10:28 pm] Dem0n -- Can you tell me what this is telling me to do? I have no clue how to deal with double pointers[2014-10-23. : 10:16 pm] jjf28 -- probably the pointer, since the only rational reason to have a pointer to a pointer is if the pointer will change somehow (be allocated/deallocated, moved too a different object, incremented or decremented); but I don't know enough about your situation to say for sure[2014-10-23. : 10:14 pm] Moose -- RoyRoy shouted: Hey Zycorax, don't take this the wrong way, but your Steam profile strongly suggests you are afflicted by fiscal irresponsibility (buying games you do not play). This mentality scales out to your spending habits in general, and you're likely vulnerable to manipulative advertising. You should take a course in personal finance and educate yourself on psychology in marketing: it will protect your wallet, and you'll have a bunch of extra money for things you actually want/need. Have you seen Moogle's?[2014-10-23. : 10:11 pm] Dem0n -- If I'm supposed to initialize something, and that thing is a passed into the function through a double pointer, what do I intialize? The thing itself? The pointer? The pointer to the pointer?[2014-10-23. : 10:02 pm] Dem0n -- It's supposed to return the hash code for a string, so I rotate the original hash, add the char value to it, and then xor it with the non-rotated hash, and repeat for every char in the string, but it's not right. |
Symmetry