|
Vanadium posted:I am pretty sure that fflushing input streams does not do anything. From the man page: code:
|
# ¿ Apr 11, 2008 18:50 |
|
|
# ¿ Apr 24, 2024 19:54 |
|
HB posted:The OS X 10.5 manpage for fflush makes no mention of input streams; it only says the function will fail if the stream is "not open for writing". I found it on this site http://www.hmug.org/man/3/fflush.php but I guess that's only for ISO C90?
|
# ¿ Apr 14, 2008 19:33 |
|
Edit: Nevermind, checkexits or whatever prints. I was confused by the name of the function.
|
# ¿ Jun 4, 2008 02:21 |
|
Whenever you're using a Room in a parameter or return value, do Room * so it affects the real one, not the copy.
|
# ¿ Jun 4, 2008 06:57 |
|
more falafel please posted:Looks like at least some browsers (Safari at least) treat & p i ) ; as & p i ;, which should render as the pi symbol. I see the PI symbol, and I'm on Firefox 2. Looks like & p i itself makes the PI symbol (it ignores the character following it, i.e. doesn't wait for a semi-colon.) &pi
|
# ¿ Jun 25, 2008 17:23 |
|
Vanadium posted:It is not browser specific, the forums do the substitution. You can tell by looking at the source. What? The source shows me the & p i, not the symbol.
|
# ¿ Jun 25, 2008 20:13 |
|
more falafel please posted:You have absolutely no understanding of what you're talking about. Doesn't adding another bit simply double the range (assuming you're only using non-negative numbers anyways.) e.g. a signed byte is 0-127 (again, assuming you aren't using the negatives), but an unsigned byte can be 0-255. If you're adding another bit doesn't that, by definition, double your range?
|
# ¿ Jul 2, 2008 17:59 |
|
sarehu posted:Here's an algorithm that scales better with respect to integer size. I don't think it's a good idea to use a macro. Why not? It can be verified that it works properly just like the function you posted can.
|
# ¿ Jul 4, 2008 17:49 |
|
Avenging Dentist posted:Macros are evil, and unless you absolutely have to, it's preferable to use an inline function to enforce type safety and all that good stuff. The 'macros are evil' is pretty lame, but I understand the type safety argument.
|
# ¿ Jul 7, 2008 00:37 |
|
Lexical Unit posted:At that point someone from our company has travel to another company to do integration testing. Which just means we compile and run our code in the other company's environment and get both of our systems up and running and see that they actually work together as the spec says they should. Obviously there's usually problems at this point as it's the first time either company has interacted with each others' components. How is this a problem from using "non-default" libraries? Instead of including a Header and CPP files in your project you include a Header and LIB files...
|
# ¿ Jul 17, 2008 19:25 |
|
Hammerite posted:Why does it say that there's no such function when there clearly is, and I've even defined the function further up in the same file? I can't see any obvious problems, but would you mind sticking the .CPP and .H files on Pastebin or something so we can see it all in context?
|
# ¿ Aug 19, 2008 18:45 |
|
That Turkey Story posted:destroybtn != destroybutton Bah, how'd I miss that
|
# ¿ Aug 19, 2008 18:47 |
|
TSDK posted:Ignoring possible overloads, then it should compile to identical code. I'm in this boat. Unless it's obvious that you're going to be checking that something is false, I use == false.
|
# ¿ Sep 3, 2008 18:11 |
|
Mustach posted:(Although a lot of the time they'll say "Visual C++" and mean C++/CLI.) Where do they do this?
|
# ¿ Sep 11, 2008 18:35 |
|
ShoulderDaemon posted:Using a tool to build your state table seems like cheating. This is why I love the CoC.
|
# ¿ Nov 24, 2008 07:57 |
|
king_kilr posted:I think questions like that tend to be a bit too easy, for example I'm a freshman CS student and I immediately see the problem there :/ You'd be surprised who shows up at interviews saying they can program.
|
# ¿ Dec 4, 2008 07:21 |
|
hexadecimal posted:How can something like that be possible? A lot of the time you don't need a Bachelor's in CS to pursue a Master's in CS, for example a lot of schools will let you hop right into a Master's in CS program with a Physics or Math degree. Though you might need to take classes to satisfy prerequisites for the classes in the graduate school, you'll probably avoid taking any introductory programming classes, and often the Graduate CS classes are weighted more toward theory than programming, so you might not do much (if any) programming in Graduate school.
|
# ¿ Dec 4, 2008 09:53 |
|
rawstorm posted:Okay, forget about the previous code I posted, let's say I dynamically allocate memory to an array of vector <int>'s like so: That won't work, either. You can't take a pointer to vector<int> and assign it a pointer to space for fooNum ints. Specifically, if you try to, you'd get this: code:
|
# ¿ Dec 11, 2008 08:34 |
|
rawstorm posted:Okay thanks guys. I have a feeling he's still just doing code:
|
# ¿ Dec 11, 2008 09:39 |
|
hexadecimal posted:It would be fine if it was constructive criticism, but I swear to god that half of my posts here just had responses trying to make fun of it for no good reason other than trolling. If you'd just stop smoking pot all of the time I think you'd see all of the problems in your posts. Not to mention that half of the time you don't even properly capitalize, which shows how little you really care about your own posts.
|
# ¿ Dec 24, 2008 02:20 |
|
Nippashish posted:Keep the terminal open? "Up+Enter" is pretty quick. Also, pro-tip: g++ untitled.cpp && ./a.out This will compile untitled.cpp, and will only run a.out if it compiles successfully.
|
# ¿ Dec 26, 2008 10:05 |
|
Dijkstracula posted:
Ugh, this still isn't a properly shuffled array.
|
# ¿ Jan 10, 2009 03:41 |
|
Jo posted:It's late and I'm getting retarded. Is there an obvious flaw with this function? Are you sure those values are going to fit into an int?
|
# ¿ Jan 23, 2009 07:29 |
|
Anunnaki posted:Okay, this is driving me up a wall. Can somebody tell me why this is giving a seg fault? It happens on line 18. Let's see how box is defined and passed into the function.
|
# ¿ Jan 23, 2009 07:30 |
|
Bitruder posted:I used TinyXML in a recent project and it's very simple to use. One thing to note, however, is that in the latest version on their website, it will not parse spaces in attributes of tags (it returns everything UP TO the first space). What do you mean spaces in attributes of tags? This isn't valid XML: <House The Name="White House" />. Unless you mean spaces in the attribute values, then that's a pretty big bug that would be missed by the TinyXML team.
|
# ¿ Jan 26, 2009 20:10 |
|
ShoulderDaemon posted:Shell scripts are written in shell, which has almost nothing whatsoever to do with C or C++. You should probably post your question in the Linux thread. What if you use the C shell (csh)?
|
# ¿ Jan 30, 2009 03:35 |
|
Mustach posted:Which is worse, an Avenging Dentist or a Grumpy Doctor? Which is worse at programming?
|
# ¿ Feb 4, 2009 01:10 |
|
Contero posted:Luabind looks fantastic. Thank you so much. Just roll your own Scheme interpreter; the language is trivial.
|
# ¿ Feb 10, 2009 03:43 |
|
That Turkey Story posted:You can with the power of SFINAE (or in C++0x with concepts)! With boost this can be done with Boost.TypeTraits and enable_if: haha, "is_convertible" for cars
|
# ¿ Feb 14, 2009 04:35 |
|
csammis posted:If you're set up to pull Windows symbols from the Microsoft symbol servers automatically instead of on-demand, that process can take a really long time. This means you've debugged WPF applications before! </offtopic>
|
# ¿ Feb 17, 2009 03:38 |
|
If you can choose where (IP:Port) the program connects, you can write a simple pass-through proxy and drop the packets in there. Would take but 10 minutes work.
|
# ¿ Feb 25, 2009 01:16 |
|
Red Blaze posted:This works great. I will just use this macro so I know the context of the error. Can't you just undefine it?
|
# ¿ Mar 3, 2009 04:46 |
|
That Turkey Story posted:No. Oh, I was thinking the original one was a macro defined outside of his project so he was stuck with it. My bad.
|
# ¿ Mar 3, 2009 09:45 |
|
Chuu posted:I have a function: You can use Boost Static Asserts or roll your own Static Asserts (it's not hard using template trickery.) Here's the Boost ones, I'm sure you can find an implementation of your own if you look around. http://www.boost.org/doc/libs/1_31_0/libs/static_assert/static_assert.htm
|
# ¿ Mar 7, 2009 09:30 |
|
Avenging Dentist posted:EDIT: Oh also static asserts won't work because the value of x is known only at runtime. Oh I figured since it was a compile time check he wanted he was hardcoding calls to the function and wanted to make sure he was only using the subset of the allowed ones, or something. Obviously I wouldn't have suggested static asserts if I knew the values were run-time.
|
# ¿ Mar 7, 2009 22:16 |
|
Jethro posted:Re-inventing the wheel is often a good idea when you're learning about wagonmaking in general. There's more to a wagon than its wheels, though, so it's still a valid exercise to make a wagon given wheels.
|
# ¿ Mar 17, 2009 21:49 |
|
I'm playing around with TMP in GCC 4.3.2's half-implementation of C++0x, and I was wondering if there was a way to somehow do the following:code:
|
# ¿ Mar 31, 2009 20:09 |
|
That Turkey Story posted:Yeah, I'm kind of in the same boat of no money, but I'm going anyway, after which I will be basically broke. Have you started looking for a new job?
|
# ¿ Apr 4, 2009 19:51 |
|
That Turkey Story posted:Wait, do I know you? I've been putting it off, but I started updating my resume this morning and have a couple of places in mind. Registering for Boostcon immediately after getting laid off probably wasn't the smartest of ideas. We talked a couple of days ago, you mentioned that you lost your job and seemed pretty bummed about it. Nothing a week of video games won't fix though, right? Edit: Or you could spend your time in COBOL and make some origami versions of peoples' avatars!
|
# ¿ Apr 4, 2009 20:23 |
|
|
# ¿ Apr 24, 2024 19:54 |
|
Zaxxon posted:does anyone know a good way of changing HSB color to RGB without using floating point math? Have you tried doing the math with 0-255 values as opposed to 0-1 values? Failing that, you could always use a Rational type to do all the math then at the end convert that to an int in 0-255 (or whatever your scale is) without using any floating point math.
|
# ¿ Apr 10, 2009 20:06 |