# Display the 219 Ascii block like turbo c++

This topic is 2834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Still struggling to find a way to make the compilers i use (either dev c++ occasionally and vis 2008 though not much) display the ascii block 219 (or 2588) as it is shown here http://ascii-table.com/ascii-extended-pc-list.php its about just over half way down.and looks like this -- >> █ but this of course does not copy paste into dev c++. It does copy paste into vis 2008 but i cant make that compile anything that i do because of an error i cant get round that asks for the exe when it doesnt exist (and no it cant be sorted because i have looked at every possible working solution to this problem and none of them solved it). I am sure it can be done as i have seen the install screen for turbo c++ and it has all the pipes and bars to jazz up the install process (like 2544, and 2567 etc) So is there a way to display the 219 block at all using cout? I have seen many programs that convert ascii into intergers and so on but im not interested in them as i want to actually display just one block, just that 219 block. I have tried alt - (enter number here) like how alt - 0149 displays the • dot, but what displays the block?

##### Share on other sites
You should be able to specify the octal or hex value in a string or char literal using the appropriate escape sequences.

have you tried:

char c = 219;

?

##### Share on other sites
Quote:
 So is there a way to display the 219 block at all using cout?

std::cout << (unsigned char)219;

However, since this is a high-order ASCII character, what that actually displays depends on the how the high-order ASCII set is mapped in your implementation, by default. It may work, it may not. If it doesn't you'll need to change the mapping.

It appears to work by default using Visual Studio.

##### Share on other sites
Quote:
 Original post by jpetrieIt appears to work by default using Visual Studio.
It will depend on your current code page, which in turn depends on the version (language version, that is) of Windows you're using. Use SetConsoleOutputCP to set the code page; 850 has that particular block graphic, as does 437.

##### Share on other sites
This works fine

std::cout << (unsigned char)219;

Thank you very much. I have no idea where i went wrong but this displays no problems.

##### Share on other sites
Quote:
 Original post by SomarlThis works finestd::cout << (unsigned char)219;Thank you very much. I have no idea where i went wrong but this displays no problems.
You still should set the output code page. For example, a Russian computer may use code page 1251* (as opposed to the UK default which is 850), which produces a different character for 219:

#include <windows.h>#include <iostream>int main() {	SetConsoleOutputCP(1251);	std::cout << (char)219 << std::endl; // Outputs "&#1067;" instead of a block.	SetConsoleOutputCP(850);	std::cout << (char)219 << std::endl; // Outputs a block, as you expected.}

_________________________________
* I don't know what the default is for Russian, but it's an example.

##### Share on other sites

This topic is 2834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628702
• Total Posts
2984299

• 23
• 10
• 9
• 13
• 13