help

This is a discussion on help within the C++ Programming forums, part of the General Programming Boards category; hey guys i i'm doing a small menu. i need to know how to arrange the alphabet in lines..the user ...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    1

    help

    hey guys i i'm doing a small menu. i need to know how to arrange the alphabet in lines..the user is going to enter. any letter per line they want. please help..thanks

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Away.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Code:
    #include <iostream>
    #include <cstddef>
    #include <algorithm>
    #include <iterator>
    
    int main()
    {
      static const char alphabet[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
          'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };
      static const std::size_t alphabet_count = sizeof(alphabet);
      std::copy(alphabet, alphabet + alphabet_count, std::ostream_iterator<char>(std::cout, "\n"));
      std::cout.flush();
    }
    There you go, the alphabet arranged in lines.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

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