c++ help
anyone knows how to print this out in c++?? any tips/hints would be helpful
0 1 2 3 4 5 6 7 8 9 ------------------------------------- 3| ! " # $ % & ' 4| ( ) * + , - . / 0 1 5| 2 3 4 5 6 7 8 9 : ; 6| < = > ? @ A B C D E 7| F G H I J K L M N O 8| P Q R S T U V W X Y 9| Z [ \ ] ^ _ ` a b c 10| d e f g h i j k l m 11| n o p q r s t u v w 12| x y z { | Press any key to continue |
![]() |
Is the standard ascii table from wikipedia. Start by outputting your first 2 literals without a line return after the second line. Then 'for loop' starting with i=33, the following: if your variable is NOT (i-23) modulus 10 (meaning every 10 iterations) flush your line and begin a new line outputting the line number and a | output itoa(i) and a space Finally outside your loop output the string 'press whatever to continue' and flush. Note that itoa is a basic C function to convert an integer into ascii and the '%' operator is the modulus. Edit note, this forum keeps eating this post alive. Its like the 4th time iv had to type this shit. For years i searched for deep truths. A thousand revelations. At the very edge...the ability to think itself dissolves away.Thinking in human language is the problem. Any separation from 'the whole truth' is incomplete.My incomplete concepts may add to your 'whole truth', accept it or think about it Последняя редакция: SkyCore#2413. Время: 21 окт. 2015 г., 01:36:50
|
![]() |
If you want to print it out just use \[oct Ascii #]
That's something used 20 years ago. Today you just copy strings over meaing you would use stringstream. For example \56 was used to print a point in coordinates. when you passed over some values into the string via '%d' the dot would have interfered, because it was to say how many digits of the dec value should be seen. Also for compability issues I wouldn't use itoa. _itoa() isn't standard c++. It's not like everybody use MSVC++ |
![]() |