|
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. : 4:10 am] O)FaRTy1billion[MM] -- in fact I used it a bit in the code I sent you to read tbl files ![]() [2014-10-13. : 4:08 am] O)FaRTy1billion[MM] -- I don't like it because it's like a secret power, like some sort deep magic that I've been afraid to play with ![]() [2014-10-13. : 4:07 am] jjf28 -- it's like a secret power that teachers refuse to give out to higher language students[2014-10-13. : 4:04 am] O)FaRTy1billion[MM] -- I had a cheap advantage of having played with ASM, so I was aware of pointers already. ![]() [2014-10-13. : 4:02 am] O)FaRTy1billion[MM] -- Just hide the pointers behind handles. That's used every day.[2014-10-13. : 4:00 am] jjf28 -- just return a pointer if you need an initialization function, don't trouble your mind with pointers to pointers ![]() [2014-10-13. : 3:59 am] O)FaRTy1billion[MM] -- and pointers to arrays of pointers! And pointers to array of pointers to pointers to arrays![2014-10-13. : 3:58 am] O)FaRTy1billion[MM] -- pointers to pointers, that's where the real fun starts.[2014-10-13. : 3:58 am] O)FaRTy1billion[MM] -- you can pass and change pointers ... if you pass it as album** ![]() [2014-10-13. : 3:52 am] Dem0n -- I think I might just have to deallocate the memory associated with each Photo stored in the Album[2014-10-13. : 3:52 am] jjf28 -- it'll change the location variable "album" and whatever variable you passed to the function will remain unchanged[2014-10-13. : 3:52 am] Dem0n -- I'm not sure because the Album is supposed to store Photo types, and there's a function that destroys the album, and the description says that I have to deallocate any memory associated with that album, and I don't know if that means I just have to free all the Photos, or if I have to free the actual Album[2014-10-13. : 3:51 am] jjf28 -- second you passed a pointer to a function, if the function changes the pointer you sent to it, the rest of your program will not know[2014-10-13. : 3:50 am] jjf28 -- two problems, first (and less important) the one keeping you from compiling, cast to Album: album = (Album*)malloc()[2014-10-13. : 3:49 am] Dem0n -- It says, "Incompatible types when assigning to type 'Album' from type 'void *'[2014-10-13. : 3:48 am] Dem0n -- If I have a function void initialize_album(Album *album), why can't I initialize that pointer using malloc?[2014-10-13. : 3:38 am] jjf28 -- free(null); /** Enter Operating System Code */ if ( isAreaAllocatedToProcess() == false ) SCREAMABOUTMEMORYVIOLATION[2014-10-13. : 3:37 am] Dem0n -- Why wouldn't my professor want me to free it if one of the allocations fails?[2014-10-13. : 3:36 am] Dem0n -- FaRTy1billionFaRTy1billion shouted: just make sure if allocating for description fails or whatever that you free that .. don't want any memory leaks xD Can you explain this nonsense to me? "You don’t have to worry about freeing memory if any memory allocation fails (e.g., one memory allocation was successful, but a second one fails)."[2014-10-13. : 3:34 am] O)FaRTy1billion[MM] -- I was thinking it'd have to be printf("%s", pic->description);, since that's the way printf is used[2014-10-13. : 3:33 am] O)FaRTy1billion[MM] -- so it wouldn't fail, but it also probably isn't good practice. ![]() [2014-10-13. : 3:32 am] O)FaRTy1billion[MM] -- Oh, I've never considered passing a string as the format of printf[2014-10-13. : 3:32 am] jjf28 -- FaRTy1billionFaRTy1billion shouted: jjf28 That should fail. wut, it's a char* to a function that takes a char* and arbitrary characters Use puts instead of printf and it will work[2014-10-13. : 3:32 am] O)FaRTy1billion[MM] -- Though when I last updated it I said I was going to eventually add one ...[2014-10-13. : 3:31 am] O)FaRTy1billion[MM] -- RoyRoy shouted: Your suggestion makes more sense for something like the EUDDB, where there isn't a search function at all. ![]() [2014-10-13. : 3:30 am] Roy -- Your suggestion makes more sense for something like the EUDDB, where there isn't a search function at all.[2014-10-13. : 3:30 am] Roy -- The wiki search is using the MediaWiki search function, not SEN's. And it actually returns the correct result, unlike Google. And SEN's searching has been vastly improved in v6 in terms of performance.[2014-10-13. : 3:28 am] jjf28 -- RoyRoy shouted: Hey jjf, just so you know, there's a search function on the left-hand side of the wiki. You don't need to do the Google thing. insite search over google? neva[2014-10-13. : 3:26 am] O)FaRTy1billion[MM] -- The equivalent in C++ is defining the functionality of what trgktrgk shouted: Photo* pic = new Photo; (C++) mentioned. ![]() ![]() [2014-10-13. : 3:26 am] O)FaRTy1billion[MM] -- also I've made lots and lots of functions for doing what you are doing ... xD[2014-10-13. : 3:24 am] Roy -- In fact, doing your Google search for me doesn't even return the randomization page.[2014-10-13. : 3:22 am] Roy -- Hey jjf, just so you know, there's a search function on the left-hand side of the wiki. You don't need to do the Google thing.[2014-10-13. : 3:22 am] O)FaRTy1billion[MM] -- just make sure if allocating for description fails or whatever that you free that .. don't want any memory leaks xD[2014-10-13. : 3:19 am] O)FaRTy1billion[MM] -- ok, then you just have to do like Photo* pic = malloc(sizeof(Photo)); to intializie it |