| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<ricebowl> int s = atoi(argv[1]); <ricebowl> however, you should probably try to understand what a pointer is <_m_> yikes, atoi again. <_m_> atoi is definitely something you do NOT want to use for commandline stuff. <Silex> boost::program_options <binrapt> Silex: Way to go :) <_m_> that'd probably be an overkill. <binrapt> Hehe <Cowmoo> why not _m_ <Cowmoo> ? <_hhh_> you probably want std::stringstream <_m_> Cowmoo: atoi doesn't check for errors. <Cowmoo> oh right, ok <ricebowl> _m_ - I doubt he's going to have to deal with errors in a school ***ignment <ricebowl> also, clearly atoi is the simplest option, even if not the best <_m_> That's a problem, actually. People learning programming only in school don't get any idea of what real code would look like. <ricebowl> depends on your definition of "real code" <ricebowl> since my code probably differs considerably from yours <_m_> yes, if you use atoi. <ricebowl> I'd more likely write my own atoi that can fail on invalid input <Cowmoo> but aren't stringstreams slooooow <_hhh_> to convert a **** from **** they are not slow <_m_> If I would want to stick to C function then I'd use strtol. <finland> greetings and salutations <_hhh_> computers today are fast <_m_> Cowmoo: does it matter if you're parsing a commandline? <ricebowl> _m_ - so would I, except that strtoul is a total pain compared to atoi <_m_> ricebowl: total pain? <_hhh_> it would take +50~ instructions on stringstream , just a guess <ricebowl> yes; you need a pointer and some other crap, IIRC <ricebowl> which means extra variable and several additional lines to check for failure <Cowmoo> I suppose <_m_> HELP, A POINTER IS SCARING ME: <rza> _m_: want to hold my hand? <ricebowl> _m_ - considering that he doesn't know the difference between int and int*, you're more than welcome to explain it <lck> wee, done <_m_> done <finland> n1 <Cowmoo> gg thx no re <ricebowl> _hhh_ - btw, I think 50 instructions is a gross underestimate <ricebowl> it probably takes 50 instructions just to call the ctor, not even to do anything useful <_hhh_> possible <ricebowl> _hhh_ - probable ;) <ricebowl> cout << endl itself is like 20 instructions + function call which does even more <binrapt> Huh? But ricebowl is the object, not the type :( <_hhh_> anyway if this guy have a new age computer he will not feel the difference :) <ricebowl> _hhh_ - not really true, it depends <ricebowl> bloat adds up eventually <binrapt> American * _m_ = &ricebowl; <ricebowl> heh <_hhh_> I think cout << endl is much more , it has to call manipulator which calls flush which can call tcflush()... blahblahblah <ricebowl> ich bin amerikaner <binrapt> Unluckily _ is not [A-Za-z], eh :( <ricebowl> _hhh_ - yes, right <binrapt> Yes, it's slower <binrapt> So? Hah! <ricebowl> it's too bad that you can't use the ' symbol in variable names in C/C++ <ricebowl> it's fun to do that in Haskell <binrapt> Yeah, names should be allowed to contain whitespace, too! <binrapt> And even = <binrapt> And operator characters in general <ricebowl> haha <binrapt> Oh, wait, crap. The whole code would be a single name! Oh noes! <_m_> Let's wait until we have a completely conforming preprocessor implementation before we add another level of complexity to it :) <OlaRune> is the language conversation still on? <OlaRune> i liked it <binrapt> OlaRune: Sure, go ahead <OlaRune> where were we <ricebowl> not sure <binrapt> Latin! <ricebowl> yeah, Latin. <ricebowl> a better question: ever invented your own language? <binrapt> Oh, I was obsessed with that stuff when I was like 10-12 <ricebowl> heh ;) <lck> how can i print a square? <ricebowl> every now & again a random, meaningless phrase pops into my head <ricebowl> the most recent was "echtoi" <ricebowl> lck - depends on what a square is <ricebowl> lck - are you referring to a pair of coordinates? <binrapt> std::cout << "Square" << std::endl; <lck> 4 x 4 of a # <lck> #### <OlaRune> no i've never invented my own language, started working when i was little, but I soon noticed how much work it was so i let it go <ricebowl> ah, I see <ricebowl> lck - you can use cout like binrapt said <ricebowl> cout << "####" << endl; cout << "####" << endl; etc. <lck> the plan was to use for loops <ricebowl> you can do that too <OlaRune> cout << "####\n# #\n####"; <lck> so i can change the num of # <OlaRune> there <OlaRune> ah ok <OlaRune> but that is not too hard <ricebowl> OlaRune - 'bout where I'm at, but I think it would be cool to have one <ricebowl> just because I could start har***ing people without them having a clue as to what I was saying <ricebowl> or pretend to speak no English <ricebowl> or intentionally distort my English <OlaRune> would be really cool <binrapt> I think I was more interested in fonts/scripts than in languages <OlaRune> but too hard <ricebowl> scripts are fun, too <ricebowl> I modified my Latin script because of the script that I was attempting to design :D <binrapt> Sometimes I insult the teachers in Chinese when they do something wrong and the Chinese students laugh their *** off <ricebowl> haha <OlaRune> haha <lck> do'h, im a moron:D forgot a cout << endl; in the outer for loop <OlaRune> ^^ <ricebowl> when I was in 7th grade, a couple of guys had a translator for one of the other Germanic languages; I don't recall now whether it was Swedish or German, want to say the former but the latter would seem more common <ricebowl> we had a substitute teacher, and they were saying something or other lewd in that language <ricebowl> and so he replied back in the same language, "Don't be rude" <OlaRune> haha <ricebowl> and they were a bit freaked out :p <OlaRune> we had 2 persian girls in our previous chemistry cl*** <OlaRune> and they were always talking persian and giggling <ricebowl> yay Farsi <OlaRune> everyone knew they were laughing about other persons <OlaRune> but noone could do anything <OlaRune> then one day the teacher saw them pointing at him, saying something <OlaRune> and then laughing <finland> then he called them foreigners and threw them out the cl***room? <finland> hilarious story <OlaRune> so he said the exact words they'd been using, loud infront of the whole cl*** <OlaRune> then they got quit <ricebowl> yay suomea <OlaRune> they thought he knew persian <ricebowl> en puhu suomea <ricebowl> lol <binrapt> Suomea on vitun saatanan perkele <OlaRune> they got owned <ricebowl> Farsi is nice <binrapt> http://en.wikipedia.org/wiki/Constructed_languages <binrapt> http://zompist.com/kit.html HAHA <ricebowl> why's that funny? :p <ricebowl> it's actually a decent primer <OlaRune> i like lojban <ricebowl> Lojban seemed reasonable <ricebowl> not practical, though <ricebowl> I like both elements; but ultimately practicality wins because I lack the time to persue things academically <OlaRune> ^^ <binrapt> I want a perfect written language for IRC <binrapt> For programming channels! <ricebowl> haha <ricebowl> I thought that was Haskell <binrapt> http://en.wikipedia.org/wiki/Engineered_language#Logical_languages <binrapt> http://en.wikipedia.org/wiki/Lojban heh <OlaRune> english?
Return to c++ or Go to some related
logs:
|
|