| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12
Comments:
<0> haha <1> Oh <2> YUY0x7: It wasn't aware that it was local sensitive. doesn string hold only ASCII chars? <0> yeah <1> Hmm ... <1> Then \n should most definitly work, it does over here! <1> Tho both of them appear to do the same thing, I don't think \n clears the buffer, while endl does <3> likoo, no, std::string is a char container, it's not bound to any encoding <0> wow <0> thats really really odd. <0> NOW \n works <0> :/ <1> lol <0> Just.. all the sudden <1> Hajuu : Dude, stop doing drugs! ;)
<0> actually the problem is that ive run out of weed.. I cant concentrait for crap <0> :P <0> -i+e <1> Ahh there you go! :) <1> Knew there was a problem ... :) <2> likoo: OK. I still think they could have done a toLower and toUpper for type specific strings <1> Then go buy some ... or stop trying to program while you don't have any at your disposal! lol <0> lol probably sound advice. <3> likoo, i agree there should be std::tolower that takes a string and a locale <0> Anyway.. I gotta head off. Will no doubt be back regularly as my c++ adventure continues :P <1> And don't get a job as a C++ programmer, you'd get fired as soon as they realize you can't work without being stoned! lol <0> LOL <1> Hajuu : If you don't have this already : www.cppreference.com <1> Good reference ... <3> likoo, but you can write that, it's trivial <0> ooh <0> awsome <0> thanks alot man <1> No problem! <1> Good night! <0> Peace out <2> YUY0x7:Yes. it is. But then I would have to extend string and use my own strings. right? <1> TradeMark : Hmm... \n doesn't work, then it does ... lol <4> heh, odd <3> likoo no, i mean a namespace scoped function, not a member function <2> I see <3> std::string tolower(std::string const&, std::locale const&) <2> or i could use _strcmpi() :) <2> to do lower case comparisons <3> yes, a case-insensitive compare should be better than converting to a common case <2> is it frowned upon using some C runtimes funtions? <3> c-bot strcmpi <5> YUY0x7, unsure on that one .. <3> c-bot _strcmpi <5> YUY0x7, you tell me! <3> likoo, not really.. if there's a better C++ alternative, yes, but otherwise not really <2> ok <3> e.g using memset instead of std::fill <2> true <2> i wonder if STL and Boost will get wide adoption once they are in the standard <2> Boost, sorry, STL is already in the standard? <3> calc stl <6> stl = Standard Template Library, a group of typesafe collections and algorithms, now mostly part of standard C++. See http://www.sgi.com/tech/stl/ for a reference guide. <3> ugh <7> Can someone tell me why myvar is still 123? http://rafb.net/paste/results/Idy8CO43.html <2> "mostly part" <4> stl is part of ansi right? <1> Valmer : Where is the main() function? <3> it's not correct to call it stl now, imho.. it's just the standard c++ library, or stdlib for short <3> <cylon> STL is a misnomer acronym first created and documented by HP. It was mostly equivalent to the container and algorithm templates that are part of today's `the C++ standard library'. If `standard library' is too much to type, use `stdlib'. <7> PM2: it starts with Start() <3> Valmer, use extern instead of static <3> static tells the compiler to make 2 copies for each cpp file <3> calc extern <6> extern = How to declare a variable in one file and use it in another: <http://www.gnomesane.net/code/extern/> <7> Really? <2> what is the best and fastest way to check for a NULL ptr on the beginning on like a group of 100 methods belonging to the same cl***, and that use that pointer? I made an "inline" method that checks for null and throws an exception, and I call it at the beginning of each method. It feels 'lousy' though <7> I thought static was always included ONCE globably. <1> Within the file it is declared in ... <1> But it's not visible from outside <3> likoo, hmm, example?
<2> A::method1{checkPtr();...} A::method2{checkPtr();...} A::checkPtr(){if (!m_ptr) throw...} <2> the ptr is set at constructor <2> but i am afraid that the calling cl*** destoys it and still calls one of my methods <3> hmmm <3> if you really need to check it every time, i don't know any other way right now <2> the whole code in that "utilitarian" cl*** depends on that pointer being valid <2> would one usually check for the PTR? or just leave it to caller to make sure that it is valid at all time? <3> it depends.. <2> ok <3> for example, a smart pointer cl***'s operator*() usually does not check the validity of the pointer it's dereferencing <3> (operator*() is dereference btw) <2> ok <2> if it poins to a null pointer then the application fail <3> yes.. you'd check before dereferencing like you do a normal pointer... if (pointer) *pointer = 10; <3> checking every time it's dereferenced or operator-> is used can be inefficient <2> the fact of the matter is that this "utilatarian cl***" was part of the cl*** that is now calling it. and the cl*** that called it is the one managing the pointer. I decoupled the cl*** into two cl***es to make the first cl*** not so big and easier to maintain <7> I've never seen the extentions .hpp. Is that common for a header? <3> likoo, hmmm ok <3> Valmer, yes they're common in C++ <3> boost's headers are all .hpp <3> it's not that it matters though, you can use any extension, or none at all <2> I am rethinking my decision now :-/ ... i like modularity. And I don't want to have an "important cl***" with 100 setter cl***es, although logically they do all work on the same data <2> so now I p*** through pointers to my decouple cl*** the data it needs to modify <7> YUY0x7: You said use extern... but how do I initilize the global extern variable? What I want is an global variable initilized to 123. <3> <6> extern = How to declare a variable in one file and use it in another: <http://www.gnomesane.net/code/extern/> <3> ah, they don't say where you can initialize <3> initialize in the cpp <7> cpp....Hmmm I shall give that a try :) <7> YUY0x7: Ok I made a quick example. I don't know where to put 'int myvar'. <7> YUY0x7:http://rafb.net/paste/results/KWSjtv91.html <3> http://rafb.net/paste/results/KWSjtv91.html <3> you didn't make it extern? <7> Well.... If I change static to extern....where would I place 'int myvar'. <8> looks complicated i better sit this one out :p <3> extern int myvar; // in the .h <3> int myvar = 123; // in one .cpp, any <7> Hmmmmmmmmm I tried that and it didn't work.....hmmm let me give that a try again :) <7> YUY0x7: I initilize myvar2 in OnInitDialog()... http://rafb.net/paste/results/zJWcGC43.html <7> It's not working how I wish for it. <3> um... not inside any function <3> this is a definition... int myvar = 123; // notice the type in there too <7> Yeah...where do I place.... int myvar = 123 ? Where should I initilize it? Ok so not in OnInitDialog()...but then where? <3> in line 61 for example <7> Hmmmmmmmmmmmm Let me try that. :) <7> YUY0x7: Very useful.... Ok.... I like that. <7> YUY0x7: I really appreciate your input and help. <3> np <9> can i convert int to string? <3> calc convert <6> convert = Using the 'translators' built into the C++ stream libraries (which are extendable), a simple conversion technique is: #include <sstream> std::stringstream tempstream; tempstream << whatever; if ( tempstream >> whateverelse ) // conversion worked!; <9> omg <9> so c++ has no toString() function? <3> No <3> you can write a function if you find it too verbose <3> (or just use boost::lexical_cast <3> ) <3> calc convert2 <6> convert2 = A nice way to convert between data types is to use a templated function to wrap around stringstreams. For Example: template<cl*** TO, cl*** FROM> TO lexical_cast(FROM blah) { TO t; std::stringstream ss; ss<<blah; ss>>t; return t; } . USE: TYPE d = lexical_cast<TYPE>(someString); *Note* this exists in boost as boost::lexical_cast in a better form (with error checking). <9> tnx <3> np <8> !g kniht <10> How can I code a program to take a screenshot of a specific part of the screen and "read" that screenshot ? <10> ... It sounds like a trojan function, but it's really not. <1> Hey guys <1> Quick question for you! <1> How do i clear the console window? Erase everything in it? <3> not standard <1> Not possible? <1> So I have to use system("cls") ? <3> that only works in windows <1> I know, and that's my problem <1> I need something that'll work in Unix and Windows <10> Another try : How can I code a program to take a screenshot of a specific part of the screen and "read" that screenshot ? <11> try doing some research - start at google
Return to
#c++ or Go to some related
logs:
haq alla #linuxhelp #c #linux child_in_time.mp3 #AllNiteCafe Nittiena #AllNiteCafe kollu porn php get the name of a variable
|
|