Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language doublexscanf("%lf ",& ampx); Constants that cannot be assigned to the x variable are
C language doublexscanf("%lf ",& ampx); Constants that cannot be assigned to the x variable are
Choose the answer A, because the A option "abc" in the title is a string, so the A option cannot be correctly assigned to the X variable. So the answer to the question is option a.

Option analysis: Although option B is an integer, it can be assigned to variable X, and the data type has been converted. If the c option inputs a character, then this character has an ASCII code value, which is equivalent to assigning the ASCII code value' a' to the X variable.

The c option can be assigned the same value as the a option, and then the assignment can be completed through type conversion. So choose answer a.

Extended data:

You can use the scanf function without a precompiled command (# include).

Function prototype: int? Scanf (constant? Charles? *? Restrictions? Format, ...);

The scanf function returns the number of data items successfully read, and returns EOF if "end of file" is encountered when reading data.

Scanf instructions for use:

The 1. whitespace character will cause the scanf function to ignore one or more whitespace characters in the input during the read operation.

2. Non-blank characters will cause the scanf function to exclude the same characters as the non-blank characters when reading in.

3. You can add an integer between the "%"format specifiers in the format string to indicate the maximum number of digits in any read operation.

4. There is no precision control like printf in the 4.scanf function.

5. When inputting character data (%c), if there are no unformatted characters in the format control string, all the input characters are regarded as valid characters.

Baidu encyclopedia -scanf