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-28. : 4:02 am] Dem0n -- They do not. That's what I don't get. There's literally no function where the size of value is given to me.[2014-10-28. : 4:01 am] poiuy_qwert -- so what is the Table creating function like? do they provide the value size there?[2014-10-28. : 3:59 am] Dem0n -- I can't change the function parameters. Those were given by my professor.[2014-10-28. : 3:44 am] Dem0n -- Or maybe I am for the value in the bucket... The descriptions of what I'm supposed to do are confusing as fuck[2014-10-28. : 3:41 am] Dem0n -- But even when I do memcpy and then set the two values equal, when I try to print the value, I get "(void *) 0x7fffffff ..."[2014-10-28. : 3:39 am] Dem0n -- Wait, but then when I do buckets->value = value, how does that work? Doesn't it still need to know what type value is?[2014-10-28. : 3:38 am] poiuy_qwert -- int save = 5; void *value = &save; size_t valueSize = sizeof(int); int load; void *param = &load; memcpy(param, value, valueSize);[2014-10-28. : 3:34 am] poiuy_qwert -- int save = 5; void *value = &save; size_t valueSize = sizeof(int); int load; memcpy(&load, value, valueSize);[2014-10-28. : 3:30 am] poiuy_qwert -- thats the only way to do it. you don't cast anything, you use memcpy to copy the correct amount of bytes[2014-10-28. : 3:28 am] Dem0n -- Hmm not sure if that's how I'm supposed to do it. But even if it is, how do I know what type to cast it as?[2014-10-28. : 3:26 am] poiuy_qwert -- you said the user provides how much memory should be allocated for it, you need to store it if you arn't already[2014-10-28. : 3:23 am] Dem0n -- I have to write a function that inserts a node into a linked list, and the node has a key/value pair. The key is a string, which is easy to put into the node, but the value is a void pointer. My TAs have said that the user of the program is supposed to specify what type value is and how much memory should be allocated for it; all I have to do is set the node's value equal to the parameter value. But I don't know how to do that if I don't know the value's type.[2014-10-28. : 3:21 am] poiuy_qwert -- Dem0nDem0n shouted: Well I have a variable value of type void*, and I have functions where I have to set that value equal to the parameter value, but the value could be any type, so I don't know what to cast it to this doesnt make much sense. how can the parameter be any type, js it a void*? what is/where is this "variable value of type void*"?[2014-10-28. : 3:14 am] jjf28 -- with void you don't know the type, and with C there's no way of extracting the type.[2014-10-28. : 3:01 am] Dem0n -- Well I have a variable value of type void*, and I have functions where I have to set that value equal to the parameter value, but the value could be any type, so I don't know what to cast it to [2014-10-28. : 2:56 am] jjf28 -- build structs with overlapping members if you know it's part of a family of structs[2014-10-27. : 11:59 pm] KrayZee -- As soon as catwoman received her clean slate, she became an astronaut.[2014-10-27. : 11:43 pm] MasterJohnny -- i want to great a matrix of even spacing for bogth rows and columns[2014-10-27. : 8:29 pm] Fire_Kame -- I could dissect his video too...but the last half are the ravings of a mad man (his whole fortresses in a wasteland) and the first half don't even cite statistics or data properly (such as the doubling rate of the disease - this is inaccurate based on the numbers we have available, but you could just as easily argue that not enough numbers are available yet to even graph the rate)[2014-10-27. : 8:27 pm] Fire_Kame -- and argued against his core idea that ebola is going to kill us all[2014-10-27. : 8:26 pm] Fire_Kame -- x3 my post was not tangent filled! It was very related to the topic at hand[2014-10-27. : 8:24 pm] O)FaRTy1billion[MM] -- I just picked out a few points that I thought to be valid, and then decided "I agree."[2014-10-27. : 7:35 pm] O)FaRTy1billion[MM] -- Though really all I read was "Straight put, this is fear-mongering at its finest." and "In short, as much as I hate the saying, keep calm and carry on. And get a damn flu shot." and skimming through bits of the rest xD[2014-10-27. : 6:05 pm] NudeRaider -- Then G-d spoke to Mose: "raise your staff and stretch out your hand over the sea and split it, and the children of Israel shall come in the midst of the sea on dry land."[2014-10-27. : 5:50 pm] Fire_Kame -- All I responded to was the misinformation about ebola and about the disease itself[2014-10-27. : 5:50 pm] Fire_Kame -- Okay maybe I should actually respond to the video too, even though he's full of shit |