Need help with display of array

This is a discussion on Need help with display of array within the C# Programming forums, part of the General Programming Boards category; I have been working for over a week on this program and I have it almost done. I just can't ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Cool Need help with display of array

    I have been working for over a week on this program and I have it almost done. I just can't get one last part.

    I have to display the contents of an array in two columns, instead of one. I have previously entered the elements in this character array with a cin. getline. I can enter up to 20 item. However many items I enter must be split equally into 2 columns that are equally spaced on an 80 line page(standard page). If I enter an odd number of items the last item will be in the first column making that column one item longer. How do i do this? I have tried strlen and "%2" and" /2". The array header looks like this: char Items[20][32]. I have used a counter and a bubble sort and can get the string to print out alpabetically in one column. How to I get it to print out into two equispaced columns?

  2. #2
    Something Clever ginoitalo's Avatar
    Join Date
    Dec 2001
    Posts
    187
    This is the C# section, post this in the C++ section
    with some relevent code.

    ie. this loop makes it go 1 off the page ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Modify an single passed array element
    By swgh in forum C Programming
    Replies: 3
    Last Post: 08-04-2007, 08:58 AM
  2. question about multidimensional arrays
    By richdb in forum C Programming
    Replies: 22
    Last Post: 02-26-2006, 08:51 AM
  3. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-11-2004, 11:15 PM
  4. Array won't display new values?
    By Kespoosh in forum C++ Programming
    Replies: 9
    Last Post: 03-17-2003, 08:22 PM
  5. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM

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