Storing a name, what variable?

This is a discussion on Storing a name, what variable? within the C++ Programming forums, part of the General Programming Boards category; I need to store a name but i don' know what variable type to use, i thought it was just: ...

  1. #1
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

    Storing a name, what variable?

    I need to store a name but i don' know what variable type to use, i thought it was just:

    char name(20);

    but its not....any help?
    Last edited by RoD; 09-27-2002 at 03:19 PM.

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    nm it was rite under my nose

    char name[50];

  3. #3
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    Why donīt use strings??? Itīs much easier to use and have better functionality. With a string it is not possible to overwrite memory like a char array (or pointer).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C variable
    By webstarsandeep in forum C Programming
    Replies: 1
    Last Post: 10-23-2008, 02:26 AM
  2. storing an unknown amount of variable
    By sreetvert83 in forum Game Programming
    Replies: 5
    Last Post: 09-17-2005, 06:42 PM
  3. variable being reset
    By FoodDude in forum C++ Programming
    Replies: 1
    Last Post: 09-15-2005, 01:30 PM
  4. float/double variable storage and precision
    By cjschw in forum C++ Programming
    Replies: 4
    Last Post: 07-28-2003, 07:23 PM
  5. storing different variable types in arrays.........
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 06-28-2002, 12:45 PM

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