Thread: Storing a name, what variable?

  1. #1
    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 02:19 PM.

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