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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:46:49+00:00 2026-05-20T09:46:49+00:00

I have a C code during which I open a file to input a

  • 0

I have a C code during which I open a file to input a hexadecimal number. Then I want to add the number obtained it to another single digit hexadecimal and finally display the number in hex. e.g. I input AC65E1 and I add E to it and display AC65EF.

Is there a way to do it without going through the conversion to decimal and adding in decimal and then converting back to hexadecimal? If no what is the time-optimum way to do it?

EDIT: I think my question my misinterpreted, I wanted to know if I can use the ‘+’ with Hex? if I couldnt then I would have to use change to decimal to use the ‘+’ operator. Sorry for any mis-typing!

Now I am reading the data from the file into a char hex_num[10];

  • 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-20T09:46:50+00:00Added an answer on May 20, 2026 at 9:46 am

    Mathematics in C and other languages are not done in any particular base — except at the lowest level of processing where, of course, they take place in binary.

    I think your question is broken because you want to add E to AC65E1 and get .. AC65E1 again. Presumably you meant AC65EF.

    I suggest read the data from the file and parse strings that look like numbers into integers, perform your arithmetic, then output them again in whatever representation you wish.

    For this, use strtol passing 16 as the base parameter, or fscanf to read into an integer in the first place.

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

Sidebar

Related Questions

I have code to create another row (div with inputs) on a button click.
I have code that looks like the following, which works fine for displaying the
I have code which retrieves a direcotry path in 2 different forms. If, in
I’m developing an application server, during which I constantly edit–recompile–rerun the code. Unfortunately, after
We have some client code which is using the SqlConnection class in .NET to
I have code which issues many HTTP GET requests using Python's urllib2, in several
I have a program which during it's run sometimes needs to call python in
I have an Excel file that has a bunch of VBA and macro code
I have this code, the point is that I want to receive no more
In C# I can use the following code to have code which only executes

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.