News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

how to display all ASCII Characters in c?

Started by bshi02, August 31, 2023, 04:04:44 PM

Previous topic - Next topic

bshi02

hello.
I stumbled on below youtube video,So I tried to compile and run this code with codeblocks,But it won't display correct ASCII Characters, particularly all Characters which is higher than 127, is totally not visible.
how to display all ASCII Characters in c?
Any reply would be appreciate.
https://www.youtube.com/watch?v=ejZT-bkXqg4&t=23s


#include<stdio.h>

int main()
{
    int count = 0;

    while(count <= 255)
    {
        printf("ASCII value of %c is %d\n\n ", count, count);
        count++;
    }

    return 0;
}

stahta01

Please read and follow this website rules!

https://forums.next.codeblocks.org/index.php/topic,9996.0.html
Quote1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

#2
Note: Asking how to use an codepage in Code::Blocks would possibly be within the CB rules.

I have no idea if Linux has codepages. But, windows OS does.
Edit2: Add link https://forums.next.codeblocks.org/index.php/topic,22168.msg150874.html

Edit: To help you would require information like CB version and Operating system information.

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

bshi02

I 'm sorry that it seems I broke the rules,But I think that this problem(to display all ASCII character from 1 to 255) is related to fiddle with any options in codeblocks.
For your infomation,I always have used Codeblocks version 20.03. and My circumstance is windows 10 Home and Setting English Language for non Unicode language..

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]