Thread: help

  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,895
    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