CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Output console

  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Output console

    I am writing a programme that outputs all the characters from 32-255. but this is what my console gave me...How can i fix the problem ?
    Thanks,
    SignOut
    Attached Images Attached Images  

  2. #2
    Join Date
    Dec 2003
    Posts
    2
    My code looks like this:
    PHP Code:
    for(int i=32;i<255;i++){
    cout<<i<<"  "<<(unsigned char)i<<flush;
    //keep little space for each number.
    ........ 

  3. #3
    Join Date
    Aug 2001
    Location
    Stockholm, Sweden
    Posts
    1,664
    How does your print statement look? (It looks like you have forgotten a parameter to printf())

  4. #4
    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    762
    Originally posted by j0nas
    How does your print statement look? (It looks like you have forgotten a parameter to printf())
    He is using C++, not C. He posted his "print statement"

    Anyway, I compiled your code and it works for me (somewhat).

    Code:
    32   33  !34  "35  #36  $37  %38  &39  '40  (41  )42  *43  +44  ,45  -46  .47  /
    48  049  150  251  352  453  554  655  756  857  958  :59  ;60  <61  =62  >63  ?
    64  @65  A66  B67  C68  D69  E70  F71  G72  H73  I74  J75  K76  L77  M78  N79  O
    80  P81  Q82  R83  S84  T85  U86  V87  W88  X89  Y90  Z91  [92  \93  ]94  ^95  _
    96  `97  a98  b99  c100  d101  e102  f103  g104  h105  i106  j107  k108  l109  m
    110  n111  o112  p113  q114  r115  s116  t117  u118  v119  w120  x121  y122  z12
    3  {124  |125  }126  ~127  ?128  Ç129  ü130  é131  â132  ä133  Ã*134  Ã¥135  ç136
     ê137  ë138  è139  ï140  î141  ì142  Ä143  Å144  É145  æ146  Æ147  ô148  ö149  ò
    150  û151  ù152  ÿ153  Ö154  Ãœ155  ¢156  £157  Â¥158  ?159  Æ’160  á161  Ã*162  ó16
    3  ú164  ñ165  Ñ166  ª167  º168  ¿169  ?170  ¬171  ½172  ¼173  ¡174  «175  »176
     ?177  ?178  ?179  ?180  ?181  ?182  ?183  ?184  ?185  ?186  ?187  ?188  ?189  ?
    190  ?191  ?192  ?193  ?194  ?195  ?196  ?197  ?198  ?199  ?200  ?201  ?202  ?20
    3  ?204  ?205  ?206  ?207  ?208  ?209  ?210  ?211  ?212  ?213  ?214  ?215  ?216
     ?217  ?218  ?219  ?220  ?221  ?222  ?223  ?224  ?225  ß226  ?227  ?228  ?229  ?
    230  µ231  ?232  ?233  ?234  ?235  ?236  ?237  ?238  ?239  ?240  ?241  ±242  ?24
    3  ?244  ?245  ?246  ÷247  ?248  °249  ?250  ·251  ?252  ?253  ²254  ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured