std::atof

来自cppreference.com

 
 
字元串庫
null結尾的字元串
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
位元組的字元串
多位元組字元串
寬字元串
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
NULL結尾的位元組串
功能
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
字元操作
Original:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
轉換為數字格式
Original:
Conversions to numeric formats
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
字元串操作
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strcpy
strncpy
strcat
strncat
strxfrm
字元串檢查
Original:
String examination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
內存操作
Original:
Memory manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
memchr
memcmp
memset
memcpy
memmove
雜項
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strerror
 
Defined in header <cstdlib>
double atof( const char *str );
解釋浮點值一個位元組的字元串所指向的str.
Original:
Interprets an floating point value in a byte string pointed to by str.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函數丟棄任何空白字元(由std::isspace()),直到找到第一個非空白字元。然後它會儘可能多的字元可能形成一個有效的浮點表示,並將其轉換為浮點值。有效浮點值可以是下列之一:
Original:
Function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating point representation and converts them to floating point value. The valid floating point value can be one of the following:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • 十進制浮點表達。它由以下幾部分組成:
    Original:
    decimal floating point expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (可選的)加號或減號
    Original:
    (可選的) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 可以選擇一個的小數點字元(定義尾數)包含的小數位數的非空序列
    Original:
    nonempty sequence of decimal digits optionally containing a decimal point character (defines significand)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (可選的)eE可選的負號或加號和非空的十進制數字序列(DEFINES指數)
    Original:
    (可選的) e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 二進制浮點表達。它由以下幾部分組成:
    Original:
    binary floating point expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (可選的)加號或減號
    Original:
    (可選的) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 0x or 0X
  • 可以選擇一個的小數點字元(定義尾數)包含十六進制數字的非空序列
    Original:
    nonempty sequence of hexadecimal digits optionally containing a decimal point character (defines significand)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (可選的)pP可選的負號或加號和非空的十六進制數字序列(DEFINES指數)
    Original:
    (可選的) p or P followed with optional minus or plus sign and nonempty sequence of hexadecimal digits (defines exponent)
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 無窮的表達。它由以下幾部分組成:
    Original:
    infinity expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (可選的)加號或減號
    Original:
    (可選的) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • INFINFINITY忽略大小寫
    Original:
    INF or INFINITY ignoring case
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 沒有一個數的表達。它由以下幾部分組成:
    Original:
    not-a-number expression. It consists of the following parts:
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • (可選的)加號或減號
    Original:
    (可選的) plus or minus sign
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • NANNAN(「char_sequence」)忽略大小寫的NAN部分。 「char_sequence」只能包含字母數字字元。其結果是一個安靜的南浮點值.
    Original:
    NAN or NAN(char_sequence) ignoring case of the NAN part. char_sequence can only contain alphanumeric characters. The result is a quiet NaN floating point value.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

目錄

[编辑] 參數

str -
null結尾的位元組串的指針進行解釋
Original:
pointer to the null-terminated byte string to be interpreted
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 返回值

double的值對應於成功str的內容。如果轉換的值落在範圍的返回類型,返回值是不確定的。如果沒有可以進行轉換,0.0返回.
Original:
double value corresponding to the contents of str on success. If the converted value falls out of range of the return type, the return value is undefined. If no conversion can be performed, 0.0 is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 為例

[编辑] 另請參閱

一個位元組的字元串轉換為浮點值
Original:
converts a byte string to a floating point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(函數) [edit]