Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8967913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:21:07+00:00 2026-06-15T17:21:07+00:00

A char in the C programming language is a fixed-size byte entity designed specifically

  • 0

A char in the C programming language is a fixed-size byte entity designed specifically to be large enough to store a character value from an encoding such as ASCII.

But to what extent are the integer values relating to ASCII encoding interchangeable with the char characters? Is there any way to refer to ‘A’ as 65 (decimal)?

getchar() returns an integer – presumably this relates directly to such values? Also, if I am not mistaken, it is possible in certain contexts to increment chars … such that (roughly speaking) ‘?’+1 == ‘@’.

Or is such encoding not guaranteed to be ASCII? Does it depend entirely upon the particular environment? Is such manipulation of chars impractical or impossible in C?

Edit: Relevant: C comparison char and int

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:21:09+00:00Added an answer on June 15, 2026 at 5:21 pm

    But to what extent are the integer values relating to ASCII encoding interchangeable with the char characters? Is there any way to refer to ‘A’ as 65 (decimal)?

    In fact, you can’t do anything else. char is just an integral type, and if you write

    char ch = 'A';
    

    then (assuming ASCII), ch will merely hold the integer value 65 – presenting it to the user is a different problem.

    Or is such encoding not guaranteed to be ASCII?

    No, it isn’t. C doesn’t rely on any specific character encoding.

    Does it depend entirely upon the particular environment?

    Yes, pretty much.

    Is such manipulation of chars impractical or impossible in C?

    No, you just have to be careful and know the standard quite well – then you’ll be safe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a sample from Kernighan & Ritchie's The C Programming Language: int getline(char
In pretty much any normal programming language, one can cast an integer/short/byte into a
here is C code from the book The C programming language: #include <stdio.h> #include
From The C Programming Language 2nd Edition: Since an argument of a function call
From The C Programming Language (Brian W. Kernighan), 2.7 TYPE CONVERSIONS, pg 43 :
The example at: http://www.d-programming-language.org/mixin.html , appears below: template GenStruct(char[] Name, char[] M1) { const
As, I think every programming language compares an int and a char on behave
This is taken right from The C++ Programming Language by Bjarne Stroustrup. I would
I'm reading The C++ Programming Language. In it Stroustrup states that sizeof(char) == 1
Quoting from Kernighan and Ritchie's 'The C Programming Language' Page 16 - #include<stdio.h> main()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.