|
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-13. : 3:19 am] O)FaRTy1billion[MM] -- is it like Photo* makePhoto(int id, char* description) ?[2014-10-13. : 3:18 am] Dem0n -- But there is none. This function has just an int and a char* as the parameters, which are the variables inside the struct that I'm supposed to be modifying[2014-10-13. : 3:18 am] O)FaRTy1billion[MM] -- so like if you have "Photo* pic; pic->id = 5;", pic isn't referencing any actual photo struct[2014-10-13. : 3:17 am] O)FaRTy1billion[MM] -- Oh, he means it's a pointer to a struct for photo, but where is the actual struct?[2014-10-13. : 3:16 am] Dem0n -- Also I'm getting a warning saying my Photo variable pic is uninitialized because I just have Photo* pic; as my declaration. What would I initialize it to if I just want to modify the contents of the struct?[2014-10-13. : 3:12 am] Dem0n -- So would doing pic->description = (char *) malloc(5); and then checking it with if(pic->description == NULL) be the right way to do that?[2014-10-13. : 3:11 am] O)FaRTy1billion[MM] -- show me all the code, I can look to see if I notice something XD[2014-10-13. : 3:09 am] O)FaRTy1billion[MM] -- try jjf's suggestion and just printing it to make sure the problem isn't something else[2014-10-13. : 3:08 am] O)FaRTy1billion[MM] -- jjf28jjf28 shouted: printf(pic->description); // This fails? That should fail. Use puts instead of printf and it will work[2014-10-13. : 3:07 am] O)FaRTy1billion[MM] -- I'll do it today or tomorrow, I just got home from work so I'm feeling particularly lazy ![]() [2014-10-13. : 3:07 am] poiuy_qwert -- not really anything specific. section validation info would be nice, other updated stuff you have as well, but it doesn't really matter much[2014-10-13. : 3:06 am] Dem0n -- Photo *pic. And then I try to do pic->description, where description is a char pointer inside the Photo struct[2014-10-13. : 3:05 am] O)FaRTy1billion[MM] -- poiuy_qwertpoiuy_qwert shouted: FaRTy, update the CHK spec Is there something you need? I pretty much listed the only things I noticed that need updating![]() [2014-10-13. : 3:05 am] Dem0n -- it's just a char pointer, but if I do like var->charptr, it says I'm requesting for member 'charptr' in something not a struct[2014-10-13. : 3:04 am] O)FaRTy1billion[MM] -- oh, it could be like *(thingy->pointer) ... but I'm not sure if the ()s are necessary[2014-10-13. : 3:04 am] jjf28 -- for some reason I thought it only had the deference operator * to work with[2014-10-13. : 3:03 am] Dem0n -- okay so if I have a pointer inside the struct, how do I access that? ![]() [2014-10-13. : 3:03 am] O)FaRTy1billion[MM] -- the only relevant thing I can think of that C doesn't have compared to C++ is referencing. ![]() [2014-10-13. : 3:01 am] Dem0n -- I created a Photo pointer variable, but I don't know how to acess the variables inside the struct[2014-10-13. : 3:01 am] Dem0n -- If I have a struct for a Photo type, and then I have a method that's supposed to return a pointer to a Photo, how do I modify the shit in the struct?[2014-10-13. : 2:58 am] O)FaRTy1billion[MM] -- like section validation, and more complete VCOD reference[2014-10-13. : 2:58 am] O)FaRTy1billion[MM] -- I should update the wiki's CHK specs with info I have but it doesn't, but I'm too lazy to. ![]() [2014-10-13. : 2:57 am] O)FaRTy1billion[MM] -- I usually write it as int* method() because it's less confusing ;o |
Vrael