Utility Class

Discussion in 'Web Design & Coding' started by Complete, Sep 11, 2007.

  1. Complete

    Complete OSNN Addict

    Messages:
    94
    I want to create a seperate Utility class -- a "CUtil" class -- to do some basic fundamental stuff like string conversions.

    OK, now, I can make all those methods as static so that I do not have to instantiate the CUtil class in order to do things.

    um...

    So how would that look in the calling routine?

    Would it be something like this:
    Code:
     
    str_return = CUtil:FunctionName(stuff);
    
     
  2. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    What programming language?

    If it is C++, you would do:

    Code:
    str_return = CUtil::FunctionName(stuff);
    That being said, are you sure that some of this stuff is not already available in one of the many STL libraries?