View RSS Feed

Recent Blogs Posts

  1. Can I haz castz?

    by , 10-12-2009 at 03:55 PM
    Inspired by Zekes passionate blogging here, I decided to write a blog. On a topic that I think deserves a bit of thought... *drumroll* Casting in C++.

    Oh yeah. It's pretty, eh?
    Code:
    const int i = 10;
    char* c = reinterpret_cast<char*>(const_cast<int*>(&i));
    If coming from a C background you are likely to have a face expression similar to this: - longing for your good old
    Code:
    char* c = (char*)&i;
    And I can honestly understand why people despise ...
    Categories
    Programming
  2. Boost: Function Object Programming

    by , 05-24-2009 at 04:34 PM
    The final section of Beyond the C++ Standard Library: An Introduction to Boost is about enhancing function support. I would love to tell you wonderful stories about how Bind, Lambda, Function, and Signals can revolutionize your programming, but the reality is that what I really learned was the limitations of my knowledge of C++.

    The C++ Standard Template Library, part of the Standard Library, is loaded with tons of useful little algorithms, containers, and amazing functionality that ...
    Tags: boost, c++ Add / Edit Tags
    Categories
    Uncategorized
  3. Boost Casts Rock!

    by , 05-13-2009 at 04:23 PM
    The Boost library adds four "casts" to the C++ language: polymorphic_cast, polymorphic_downcast, numeric_cast, and lexical_cast. The first two, polymorphic_cast and polymorphic_downcast allow you to be a little bit safer or clearer than using dynamic_cast and static_cast. These are interesting to me, but nothing compared to the awesomeness that is numeric_cast and lexical_cast.

    numeric_cast allows you to deal with overflows when converting between integral types. It handles both ...
    Tags: boost, c++ Add / Edit Tags
    Categories
    Uncategorized
  4. sentinel-control-structure vs counter = 0 or counter = 1

    by , 03-01-2009 at 10:27 AM
    Yesterday I was re-reading about the sentinel-control-structure, and I came back to my problem on why the author initialize the counter from 0 or from 1 (in two different cases).
    For the discussion thread, please look at here
    http://forum.codecall.net/c-c/14435-...structure.html


    I will first let you guys see what are the two cases:

    First case (definite-counter-control structure)
    Task: You are ask to develop a program that will ...
    Categories
    Programming