Members in Shoutbox
None.

Shoutbox Search
Search for:


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.
Pages: < 1 « 3318 3319 3320 3321 33223572 >

[2014-10-13. : 4:16 am]
jjf28 -- strlen()+1 is a safer habit
[2014-10-13. : 4:15 am]
O)FaRTy1billion[MM] -- char thing[] = "Waffles", that is
[2014-10-13. : 4:15 am]
O)FaRTy1billion[MM] -- like char[] = "Waffles"; you can probably do sizeof
[2014-10-13. : 4:15 am]
Dem0n -- it is a constant :O
[2014-10-13. : 4:15 am]
O)FaRTy1billion[MM] -- if it's a constant sizeof might work, but otherwise it would be strlen(char1)+1
[2014-10-13. : 4:14 am]
Dem0n -- Or do I need to use sizeof?
[2014-10-13. : 4:14 am]
Dem0n -- Wait, if I have a string that I want to copy, but I first need to allocate memory for it, would I do char2 = (char *) malloc(strlen(char1))?
[2014-10-13. : 4:14 am]
jjf28 -- and immediately before it there's 9 bytes allocated for something
[2014-10-13. : 4:14 am]
jjf28 -- i would assume there's no bytes allocated at [...]
[2014-10-13. : 4:13 am]
O)FaRTy1billion[MM] -- no idea :O
[2014-10-13. : 4:13 am]
Dem0n -- What does this mean: "Address [...] is 0 bytes after a block of size 9 allocated"
[2014-10-13. : 4:12 am]
jjf28 -- _CrtDumpMemoryLeaks(); werks for me
[2014-10-13. : 4:11 am]
Dem0n -- I have no clue what it's telling me though lul
[2014-10-13. : 4:11 am]
Dem0n -- it's some command that you can use that shows you were you get memory leaks
[2014-10-13. : 4:11 am]
O)FaRTy1billion[MM] -- images_tbl + *(((unsigned short*)images_tbl)+imagesdat.grpfile[img]) -- being lazy is way higher than making pretty code. :P
[2014-10-13. : 4:11 am]
jjf28 -- nopes
[2014-10-13. : 4:11 am]
Dem0n -- are you guys familiar with valgrind? :O
[2014-10-13. : 4:10 am]
jjf28 -- :lol:
[2014-10-13. : 4:10 am]
jjf28 -- so it looked like it had a unibrow
[2014-10-13. : 4:10 am]
jjf28 -- it had a tiny speck of something right inbetween the eyebrows of that ' :P '
[2014-10-13. : 4:10 am]
O)FaRTy1billion[MM] -- Except it's also mixed in with recasting hell xD
[2014-10-13. : 4:10 am]
jjf28 -- holy crap my monitor
[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 :P
[2014-10-13. : 4:09 am]
O)FaRTy1billion[MM] -- I use it sometimes ...
[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 :P
[2014-10-13. : 4:08 am]
jjf28 -- really? not even just to step through an array?
[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:07 am]
O)FaRTy1billion[MM] -- D: I don't like pointer arithmetic.
[2014-10-13. : 4:06 am]
jjf28 -- lel pointer arithmetic
[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. :P
[2014-10-13. : 4:03 am]
jjf28 -- it's fun once you get it, but learning it? grossness
[2014-10-13. : 4:02 am]
O)FaRTy1billion[MM] -- Just hide the pointers behind handles. :P That's used every day.
[2014-10-13. : 4:02 am]
O)FaRTy1billion[MM] -- Hell? Who says it's hell?
[2014-10-13. : 4:00 am]
jjf28 -- that hell will come later =D
[2014-10-13. : 4:00 am]
jjf28 -- not yet ne ways
[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 :P
[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:59 am]
Dem0n -- I'd rather not
[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** :P
[2014-10-13. : 3:58 am]
jjf28 -- woops, local variable "album"*
[2014-10-13. : 3:55 am]
Dem0n -- sorry lel
[2014-10-13. : 3:55 am]
Dem0n -- I am rubber ducking the shit out of you guys
[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:51 am]
Dem0n -- jk I think I do have to do that
[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:50 am]
Dem0n -- oh wait I guess I don't have to do that
[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:42 am]
O)FaRTy1billion[MM] -- .. which also works.
[2014-10-13. : 3:42 am]
O)FaRTy1billion[MM] -- just realloc null
[2014-10-13. : 3:40 am]
jjf28 -- o that's right
[2014-10-13. : 3:39 am]
trgk -- actually free(null) won't do anything, defined by c standard
[2014-10-13. : 3:38 am]
jjf28 -- free(null); /** Enter Operating System Code */ if ( isAreaAllocatedToProcess() == false ) SCREAMABOUTMEMORYVIOLATION
[2014-10-13. : 3:38 am]
Dem0n -- nvm I see why
[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 -- FaRTy1billion
FaRTy1billion 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] -- or "%s\n", if you like newlines.
[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]
jjf28 -- meh, i just cout ne ways :wob:
[2014-10-13. : 3:33 am]
O)FaRTy1billion[MM] -- so it wouldn't fail, but it also probably isn't good practice. :P
[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 -- FaRTy1billion
FaRTy1billion shouted: jjf28 That should fail. :P Use puts instead of printf and it will work
wut, it's a char* to a function that takes a char* and arbitrary characters
[2014-10-13. : 3:32 am]
trgk -- https://db.tt/Pyiv47Z1
[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] -- I'm too lazy for a search.
[2014-10-13. : 3:31 am]
O)FaRTy1billion[MM] -- Roy
Roy shouted: Your suggestion makes more sense for something like the EUDDB, where there isn't a search function at all.
:P

Pages: < 1 « 3318 3319 3320 3321 33223572 >


Members Online: Zakerozi