Thread: data types

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    2

    data types

    im trying to store someones initials in a variable, but im not sure how to do it, because I can't figure out which data type to use.

    for example

    <datatype> foo = "T.A"

    or something..

  2. #2
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    You can use a character array (char[]), but I would recommend using a std::string from <string>. It much easier to use, and will take care of its own memory management.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    2
    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extending basic data types.
    By nempo in forum C++ Programming
    Replies: 23
    Last Post: 09-25-2007, 03:28 PM
  2. Replies: 4
    Last Post: 06-14-2005, 05:45 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. Using enumerated data types
    By SXO in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2001, 06:26 PM