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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:19:54+00:00 2026-06-15T05:19:54+00:00

double strtod(const char *str, char **endptr); The argument endptr is a pointer to a

  • 0

double strtod(const char *str, char **endptr);

The argument endptr is a pointer to a pointer. The address of the character that stopped the scan is stored in the pointer that endptr points to.

why bother using (char **endptr) instead of (char ch) or (char *chptr) in the function strtod().

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-06-15T05:19:55+00:00Added an answer on June 15, 2026 at 5:19 am

    why bother using (char **endptr) instead of (char ch) or (char *chptr) in the function strtod()

    Because that argument is meant to give information to the caller. So it must modify memory that the caller controls, and that is typically and most easily done by passing the address of a variable in the caller.

    One could have an argument of type char* that points to a single char variable in the caller, but that would not allow an easy check of whether the result should be accepted (e.g. if trailing whitespace is to be ignored) or if further processing of the remainder of the input string is desired.

    Having the type char** allows using strtoX in parsers quite comfortably, they leave a pointer to the remainder of the string after they have consumed their part.

    If the type were char*, and only the char after the part strtoX consumed were saved, it would require locating the point of further parsing by essentially re-parsing the number.

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

Sidebar

Related Questions

From definition double strtod ( const char * str, char ** endptr ); C
Double-clicking a TStaticText on a form copies the caption of that TStaticText to the
The standard C library functions strtof and strtod have the following signatures: float strtof(const
Double-clicking a line in logcat that's part of a stacktrace will normally open the
I have this struct: typedef struct { void (*func)(instruction); union { double db; char
- (double) tableSize { double tableSize1=[self tableView:tableViewA numberOfRowsInSection:0]*tableViewA.rowHeight; return tableSize1; } I use that
I need to change locale in the thread to parse a double with strtod()
double? test = true ? null : 1.0; In my book, this is the
double d[10]; int length = 10; memset(d, length * sizeof(double), 0); //or for (int
Double has range more than a 64-bit integer, but its precision is less dues

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.