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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:11:11+00:00 2026-06-18T12:11:11+00:00

I am just learning C and in my class this is a part of

  • 0

I am just learning C and in my class this is a part of our first program.

The full description of the function I am trying to implement:

if that’s tl;dr, a key point is that I am not allowed to use functions from other libraries (so something like srtol is ruled out).

int parseHexString(char *hexString, int *integerRead); The first
parameter is a null terminated C string, that represents a hexadecimal
integer. This function parses this string, accumulating the integer
value it represents. This integer value is placed at the location
pointed to by the second parameter, integerRead. If a bad hexadecimal
character, thus an invalid hex value, is encountered, this function
stops looking at further characters within the string and returns -1.
If a good hex value is parsed, it returns 0.

The correct way to implement this function looks at the first
character within the string first and does not use a stack to
accomplish the parsing. Your first assembly language program will need
to implement what this function accomplishes, so you will save
yourself time by implementing this function the correct way.

For this function, do not call any functions from any libraries; as an
exception, for debugging purposes only, you may use printf(). It will
help our grading if you remove your debugging code before you submit
your assignment.

I am NOT just looking for a full implementation of this function, just some tips or hints to get me started.

I feel as though there is some intuitive way of doing this, but right now I am blanking. I’m concerned with how I am supposed to start at the first character of the string and then go forward from there to convert it to decimal.

  • 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-18T12:11:11+00:00Added an answer on June 18, 2026 at 12:11 pm

    How about:

    • Get the length of the string
    • Walk the string from left to right
    • For each character:
      • Check if it’s a valid hex character
      • Add its decimal value multiplied by 16^x, where x is the number of characters left on the right
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just learning Spring3 Validation with Hibernate. I have this class but I
I'm just learning to program and have decided to try Ruby. I'm sure this
I'm enrolled in Coursera ML class and I just started learning about neural networks.
Just learning the world of jquery, and all my googling gives examples like this:
Im just learning mod_rewrite and regex stuff, and what I'm trying to do is
I'm just learning MVC3 now and this is really confusing me. I have a
I am just learning how to use spl_autoload_register I have a folder structure that
So I've just started learning C for a class of mine, and I have
I'm very new in learning Clojure. This intended to be my first and very
I'm trying to write some metaprogramming code such that: Inheriting from some class foo<c1,

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.