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 737479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:43:34+00:00 2026-05-14T07:43:34+00:00

I having few questions about typed in ANSI C: 1. what’s the difference between

  • 0

I having few questions about typed in ANSI C:
1. what’s the difference between “\x” in the beginning of a char to 0x in the beginning of char (or in any other case for this matter). AFAIK, they both means that this is hexadecimal.. so what’s the difference.

  1. when casting char to (unsigned), not (unsigned char) – what does it mean? why (unsigned)’\xFF’ != 0xFF?

Thanks!

  • 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-05-14T07:43:34+00:00Added an answer on May 14, 2026 at 7:43 am

    what’s the difference between “\x” in
    the beginning of a char to 0x in the
    beginning of char

    The difference is that 0x12 is used for specifying an integer in hexadecimal, while “\x” is used for string literals. An example:

    #include <stdio.h>
    
    int main(){
      int ten = 0xA;
      char* tenString = "1\x30";
      printf("ten as integer: %d\n", ten);
      printf("ten as string: %s\n", tenString);
      return 0;
    }
    

    The printf’s should both output a “10” (try to understand why).

    when casting char to (unsigned), not
    (unsigned char) – what does it mean?
    why (unsigned)’\xFF’ != 0xFF?

    “unsigned” is just an abbreviation for “unsigned int”. So you’re casting from char to int. This will give you the numeric representation of the character in the character set your platform uses. Note that the value you get for a character is platform-dependent (typically depending on the default character encoding). For ASCII characters you will (usually) get the ASCII code, but anything beyond that will depend on platform and runtime configuration.

    Understanding what a cast from one typ to another does is very complicated (and often, though not always, platform-dependent), so avoid it if you can. Sometimes it is necessary, though. See e.g. need-some-clarification-regarding-casting-in-c

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

Sidebar

Related Questions

There are a few other questions about this error, but I'm having a hard
So I am having a few problems with settings this up. Let me explain.
I'm a rookie designer having a few troubles with this page: http://www.resolvegroup.co.nz/javasurvey.php There are
Ok, I have asked a few questions about different facets of trying to accomplish
I know there are plenty of questions here already about this topic (I've read
There's a few previous questions on StackOverflow questioning how one goes about accessing local
I asked a few questions about SQLite here, and maybe its because I'm not
I have a few questions about security using PHP, I dont want to use
There are a few questions on this, but they all seemed to be targeting
I have few questions about handling large bitmaps, I couldn't find answer on the

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.