Arrays

This is a discussion on Arrays within the C++ Programming forums, part of the General Programming Boards category; Ok I set an array but it wont execpt spaces? Is there a Tutorial on this or can any instruct ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    33

    Arrays

    Ok I set an array but it wont execpt spaces? Is there a Tutorial on this or can any instruct me how to get it to work? The array is in a loop and the loop goes crazy when is sees the space.



    Thanks

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    post your code we are not psychic and dont forget the [ c o d e ][ / c o d e ] tags.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Using my crystal ball, I suggest that you use cin.getline instead of cin. Make sure you call cin.clear and cin.ignore after every call of cin.getline to make sure that you will have no problems with the input the next time.

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    "Make sure you call cin.clear and cin.ignore after every call of cin.getline to make sure that you will have no problems with the input the next time."

    Why would you have any problems? cin.getline reads up to the delimiter and removes it from the stream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function to read in two arrays
    By ssmokincamaro in forum C Programming
    Replies: 7
    Last Post: 11-12-2008, 06:59 AM
  2. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 03:24 PM
  3. Replies: 16
    Last Post: 01-01-2008, 03:07 PM
  4. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 09:47 PM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 08:24 PM

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