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 « 3317 3318 3319 3320 33213570 >

[2014-10-13. : 3:19 am]
Dem0n -- yeah
[2014-10-13. : 3:19 am]
O)FaRTy1billion[MM] -- is it like Photo* makePhoto(int id, char* description) ?
[2014-10-13. : 3:19 am]
Dem0n -- I don't know what I'm doing :hurr:
[2014-10-13. : 3:18 am]
Dem0n -- But there is none. :O 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:18 am]
trgk -- Then pic should be initialized to that photo.
[2014-10-13. : 3:17 am]
Dem0n -- I don't know if that's what you were asking >_>
[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:17 am]
Dem0n -- It's a struct for Photo
[2014-10-13. : 3:17 am]
trgk -- What struct instance are you modifying?
[2014-10-13. : 3:17 am]
poiuy_qwert -- Photo *pic = null;
[2014-10-13. : 3:16 am]
O)FaRTy1billion[MM] -- uninitialized? I don't know what that means xD
[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:15 am]
Dem0n -- o
[2014-10-13. : 3:15 am]
O)FaRTy1billion[MM] -- ya
[2014-10-13. : 3:12 am]
Dem0n -- If I wanted to allocate 5 bytes
[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] -- oh ok
[2014-10-13. : 3:11 am]
Dem0n -- I see what I did wrong
[2014-10-13. : 3:11 am]
Dem0n -- oh lololol i was looking in the wrong spot
[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:10 am]
Dem0n -- Well I can't compile it because of those errors
[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] -- I don't see why that wouldn't work
[2014-10-13. : 3:08 am]
Dem0n -- Photo is a struct with an int id and a char* description
[2014-10-13. : 3:08 am]
O)FaRTy1billion[MM] -- jjf28
jjf28 shouted: printf(pic->description); // This fails?
That should fail. :P 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 :P
[2014-10-13. : 3:07 am]
jjf28 -- bb 20ish
[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:07 am]
jjf28 -- printf(pic->description); // This fails?
[2014-10-13. : 3:07 am]
O)FaRTy1billion[MM] -- what is Photo's definition?
[2014-10-13. : 3:07 am]
O)FaRTy1billion[MM] -- :O
[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:06 am]
O)FaRTy1billion[MM] -- what is var's declaration?
[2014-10-13. : 3:05 am]
O)FaRTy1billion[MM] -- poiuy_qwert
poiuy_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:05 am]
jjf28 -- you can pull it out, like: int* something = thingy->pointer;
[2014-10-13. : 3:05 am]
poiuy_qwert -- FaRTy, update the CHK spec :(
[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 -- is the pointer pointing to a single variable? another structure?
[2014-10-13. : 3:04 am]
O)FaRTy1billion[MM] -- what do you mean?
[2014-10-13. : 3:04 am]
O)FaRTy1billion[MM] -- thingy->pointer ?
[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? :P
[2014-10-13. : 3:03 am]
O)FaRTy1billion[MM] -- like dostuff(Photo &thingy)
[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. :P
[2014-10-13. : 3:02 am]
O)FaRTy1billion[MM] -- why wouldn't it?
[2014-10-13. : 3:02 am]
jjf28 -- wait, C has the arrow? :O
[2014-10-13. : 3:02 am]
Dem0n -- o
[2014-10-13. : 3:02 am]
O)FaRTy1billion[MM] -- it'd be thingy->member
[2014-10-13. : 3:01 am]
O)FaRTy1billion[MM] -- like dostuff(Photo *thingy) ?
[2014-10-13. : 3:01 am]
jjf28 -- stupid C, i like the c++ for this better
[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. :O
[2014-10-13. : 2:58 am]
O)FaRTy1billion[MM] -- you can also do "int * method()"
[2014-10-13. : 2:58 am]
O)FaRTy1billion[MM] -- then he's weird xD
[2014-10-13. : 2:57 am]
Dem0n -- idk my professor wrote it with the * attached to the method name
[2014-10-13. : 2:57 am]
O)FaRTy1billion[MM] -- the type is "int*", not just int.
[2014-10-13. : 2:57 am]
jjf28 -- yep, i would encourage you to write *'s next to the variable type :)
[2014-10-13. : 2:57 am]
O)FaRTy1billion[MM] -- I usually write it as int* method() because it's less confusing ;o
[2014-10-13. : 2:56 am]
O)FaRTy1billion[MM] -- yes
[2014-10-13. : 2:56 am]
Dem0n -- so like int *method_name(int x) would return an integer pointer?
[2014-10-13. : 2:56 am]
O)FaRTy1billion[MM] -- it's not void, it's void*.
[2014-10-13. : 2:56 am]
Dem0n -- okay well it's not actually void lul
[2014-10-13. : 2:56 am]
Dem0n -- D:
[2014-10-13. : 2:56 am]
jjf28 -- void* would mean it returns a pointer with no specific type
[2014-10-13. : 2:55 am]
jjf28 -- it returns a pointer to something
[2014-10-13. : 2:54 am]
Dem0n -- Like void *method_name(int x, int y)

Pages: < 1 « 3317 3318 3319 3320 33213570 >


Members Online: Vrael