common functions

This is a discussion on common functions within the C++ Programming forums, part of the General Programming Boards category; While I'm learning c++, I'm finding myself having to write lots of functions that are common to other "easier" languages. ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    128

    common functions

    While I'm learning c++, I'm finding myself having to write lots of functions that are common to other "easier" languages. This would be stuff like trim and replace.

    Does anyone have a common header file of all such common functions?

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    128
    just found out that replace is part of the string class. i'll have to look over that class some more.

  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,799
    If you are working with strings or character arrays, then the STL can provide you with function that will help with such tasks as trim and replace. For example, the STL has functions such as replace, replace_if, replace_copy, replace_copy_if which can be called on character arrays. The string container has member functions such as replace and substr that can perform the job of replacing and trimming character strings.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  4. #4
    ^ Read Backwards^
    Join Date
    Sep 2005
    Location
    Earth
    Posts
    282

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 02:35 AM
  2. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  3. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 05:39 AM
  4. Inline functions and inheritance
    By hpy_gilmore8 in forum C++ Programming
    Replies: 3
    Last Post: 01-14-2004, 05:46 PM
  5. functions - please help!!!!
    By linkies in forum C Programming
    Replies: 1
    Last Post: 08-21-2002, 07:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21