Thread: Help with 2-D character array

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    11

    Question Problems with 2-D character array

    Code:
    ...
    stdID[1000];   //1-D array that stores a 8-digi Student ID
    StdName[1000][50];   //2-D array that stores Student Name
    ...
    Is there any ways that enable me to check whether user enters a correct information for each array. That is, warns user if he enters character in stdID field? Moreover, each student ID must be formed by 8-digi, so how can I check the user inputs if he really keys in complete 8 digi? Is it checking the position of '\0'?

    One more, how can I find the end of the array, that is the amount of coloums of an array that have been used. (You may want to know why I want to know this...It's because, I want to continue to add some more data to an existing array that has been sotred some other data before.)

    Sorry to ask such stupid question yet I'm new in C++. Thx for anyone!
    Last edited by choykawairicky; 05-13-2004 at 10:37 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Character Array comparison
    By magda3227 in forum C Programming
    Replies: 7
    Last Post: 07-09-2008, 08:36 AM
  2. Replies: 7
    Last Post: 05-11-2008, 10:57 AM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  4. two dimensional character array
    By feuerraeder in forum C Programming
    Replies: 4
    Last Post: 11-22-2002, 08:59 AM
  5. Array of Character Arrays
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 02-09-2002, 06:07 PM