| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11
Comments:
<0> i used delete initially with malloc, but i got yelled at. :) <1> :| <2> :< <0> either way, somethings going wrong somewhere in my app and i thought it might have been that convertion routine,... <0> as the debug log shows weird stuff comming from it <0> but i guess it could be any type of memory corruption <0> first time it works fine: <0> Message: converted wchar to stl string : graphics/bg.jpg <0> Message: XML READ : texture-filename : graphics/bg.jpg <1> Use malloc with free, and delete with new <1> Don't mix those <0> but second time: <0> Message: converted wchar to stl string : graphics/cursor.bmp2006 <0> Message: XML READ : texture-filename : graphics/cursor.bmp2006 <0> it adds stuff to the end of the string
<1> It adds the system year <1> Which means you're adding it <1> Or you're using a string that once contained it <0> nope <2> ... <0> in another string it added a question mark <0> Message: converted wchar to stl string : cursor? <0> Message: XML READ : texture-name : cursor? <0> seems like it's adding random stuff <0> that wcstombs is supposed to return the correct size anyway,.. <1> 2006 isn't random, dopey <3> Thus, the multibyte character string at mbstr is null-terminated only if wcstombs encounters a wide-character null character during conversion. <0> so i have to add a \0 ? <0> or check for null termination? <3> i can't tell from the documentation if the size it returns when p***ed in NULL includes a terminating null or not <4> Gothi[c] if you're gonna use malloc (dumb idea in C++) you use free...... if you're using new, you use delete <0> vawjr: yes fine, i already corrected that now, but that's not the issue. <4> I'm trying to catch up <3> yep, it's excluding the null <3> i think <3> stupid documentation. if it does the conversion (non-null input), it returns the number of bytes written. if the input is null, it returns the byte size of the string. <3> number of bytes written does not include null <3> but it doesn't mention the size <0> so i could do something like if (somechar[sizeof(somechar)] != "\0") somechar[sizeof(somechar+1)] = "\0"; <3> simple examination under a debugger would tell you <3> you'd do buffer[size - 1] = '\0'; to be sure <3> but if the size doesn't include the null, you're going to truncate by a character <0> right <3> the documentation is why i hate string manipulation functions <0> ugh, what a pain for something so basic. <3> does it do this, or that, this or that, this or that <0> yeah,.. <3> if you're on windows, you can also use WideCharToMultiByte <0> i know, but i want to keep it cross platform <3> does lexical_cast have a wstring to string specialization? <3> never checked <0> ah i dunno, isn't that a boost thingie? <0> i never even used that <3> my guess is probably not <3> yes, it's a boost lib <4> peterhu try a small sample program using one <3> too lazy <3> speaking of lazy, time for some bf2 <0> heh <4> peterhu apparently the answer is no... at least vc8 complains <3> good to know <3> heh, now that friendly claymores don't go off, you can do some SERIOUS whoring <3> a sniper with a support = instant fortifications <1> http://img.photobucket.com/albums/v432/Black92LX/IMG_4671.jpg <5> nice tiles <1> Not my picture <5> nice wood work too <6> can anyone tell me how to fscan something and put the value on a variable? <6> anyone online?? <3> try /join #c main <6> thanks peterhu <7> if you want to laugh a little http://video.google.com/videoplay?docid=-7193470719293309352 <8> agh, now I have to use qsort() (working on a pre-ANSI C++ project (converting it really isn't an option)) and I'm getting a bus error <8> qsort(table, sizeof *table, *count, (int(*)(const void*,const void*))strcmp); <-- anything obviously wrong with this? (other than it makes you want to barf)
<9> qsort? <9> heh <8> yes <9> The channel, yes <9> It's wrong <8> how so? <9> std::sort() <8> don't have it <9> What's the type of table and count? <8> table is a char ** (malloc'd list of strings) <8> table is an int * <8> err <8> count <8> the table prints ok <9> Seems ok, if I remember the arguments of qsort correctly <9> (data, size of an element, elements count, compare)? <8> right <8> I thought maybe the function pointer cast was a problem <9> It doesn't compile? <8> it does <7> What is sizeof *table supposed to mean? <9> Then the cast doesn't really matter, it's the same for qsort()'s internals <9> sizeof(char *) <9> Since *table is a char* <7> The table is 1 byte long? <7> ( I dunno how qsort works ) <9> So it crashes, it doesn't sort? <8> I get a bus error, yeah <8> d'oh <8> no wonder my terminal is so sloiw <8> some moron is running 7 instances of a program that is trying to use 100% CPU <8> and he's not even logged in <5> Are you there debugger? <5> hey prog <10> meh <9> h0h0 <10> bah <10> I cant find my ethernet plug closer (however you call those things) <10> and i need a cable <9> I can DCC you some <10> -.-;; <5> I'm using dev-C++ and I want to make a game that uses the keyboard. Is there a function that will allow a higher maximum keys pressed simultaniously than others? <10> Rizzo: the keyboard is the limitation there <9> True, true <9> Evil keyboards <9> Gotta love pads <10> though theoretically usb keyboards shouldnt have that <5> Yes, but it is a simple game as I am at basic level <10> shouldnt/shouldnt have to <10> Rizzo: short answer: no <9> Long answer: no no no <10> Rizzo: longer answer: blah blah blah NO <9> :> <5> Can someone tell me the keyboard function to use? <10> and no we aren't being mean here :P <5> I don't know the function <10> then why even bother with a faster one? <5> and the source file it requires <10> personally i liked the map keyboard interface.. but alas that was DOS :P <10> danged i really need that cable hehe <9> DirectInput <5> Hey Valmer <11> Hi :) <11> I'm trying to find a way to register for a windows event that will tell me if my network is up or down in c++? Any ideas? <5> I want to make a loop until the user hits a key, how do I do this? <10> dont.. just wait for the key <10> busy waiting loops are the **** <5> I want it to loop without a for statement <9> Just draw the state of your game <9> And check if a key has been pressed, just before drawing <9> Use a while then ;) <10> lol
Return to
#c++ or Go to some related
logs:
write xml to textfile
#linux muppets dinasaurs #teens italiankn #c++ #linux #AllNiteCafe Heavens to Mergatroy Mrxvt screenrc
|
|