C++

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2008
Posts: 2
Reputation: shamin is an unknown quantity at this point 
Solved Threads: 0
shamin shamin is offline Offline
Newbie Poster

C++

 
0
  #1
Mar 16th, 2008
k hi every1, im kinda new to C++, anyways..this is an assignment for my college.
im supposed create a program that displays the username in a "creative" way.
so first thing is do i use the get and ignore functions to get the initial if the user enters the whole name?
and if so then how do i display the name creatively?k does anyone know how to display a letter with '*'s? for example, say the letter C

*********
*
*
*
*
*********
Last edited by shamin; Mar 16th, 2008 at 1:17 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: C++

 
0
  #2
Mar 16th, 2008
> how to display a letter with '*'s? for example, say the letter C
something like this, perhaps?
  1. #include <iostream>
  2.  
  3. enum { HEIGHT = 8, WIDTH = 8 };
  4.  
  5. const char* const C_bitmap[HEIGHT] =
  6. {
  7. "********\n", "********\n",
  8. "**\n", "**\n", "**\n", "**\n",
  9. "********\n", "********"
  10. };
  11.  
  12. int main()
  13. {
  14. for( int i=0 ; i<HEIGHT ; ++i )
  15. std::cout << C_bitmap[i] ;
  16. std::cout << '\n' ;
  17. }
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 2
Reputation: shamin is an unknown quantity at this point 
Solved Threads: 0
shamin shamin is offline Offline
Newbie Poster

Re: C++

 
0
  #3
Mar 16th, 2008
hey thanks..but i dont understand what you have done...???im really sorry.im a super beginner!and also when i complile no errors but wen i build it i get 4 errors!why??so lets say if i want to hav the letter D il have to do the whole "*********\n", "** **\n", ..... thing is it??
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: C++

 
0
  #4
Mar 16th, 2008
> when i compile no errors but wen i build it i get 4 errors!
what are the errors? and which compiler are you using?

> if i want to hav the letter D il have to do the whole "*********\n", "** **\n", ..... thing is it??
yes, you need one pattern for each letter. and a look-up mechanism to get to the right pattern given a particular letter.

> im a super beginner!
perhaps you could attempt something simpler. eg. display a name like this:
  1. ***********************
  2. * *
  3. * Aureliano Buendia *
  4. * *
  5. ***********************
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC