Author Topic: how to display all ASCII Characters in c?  (Read 3198 times)

Offline bshi02

  • Single posting newcomer
  • *
  • Posts: 2
how to display all ASCII Characters in c?
« on: August 31, 2023, 04:04:44 pm »
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;
}

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: how to display all ASCII Characters in c?
« Reply #1 on: August 31, 2023, 04:41:31 pm »
Please read and follow this website rules!

https://forums.codeblocks.org/index.php/topic,9996.0.html
Quote
1. 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: how to display all ASCII Characters in c?
« Reply #2 on: August 31, 2023, 05:05:29 pm »
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.codeblocks.org/index.php/topic,22168.msg150874.html

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

Tim S.

« Last Edit: August 31, 2023, 05:12:09 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline bshi02

  • Single posting newcomer
  • *
  • Posts: 2
Re: how to display all ASCII Characters in c?
« Reply #3 on: August 31, 2023, 05:18:47 pm »
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..

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org