C language study notes (4)

My handwritten notes



MOOC Code

my question

  1. % D% i and the difference between:
  • Solution: When using the printf format string, there is no difference. When used in a scanf format string, there are differences: in scanf format,% d matches only decimal integer; and% i can match octal, decimal, hexadecimal, integer representation. For example: If the number entered is the prefix 0 (018,025),% i will take it as an octal number to deal with, if there is a prefix 0x (0x54), it will be handled in hexadecimal.

PTA issues

  1. Structure type and structure variables are occupied memory?
  • Resolution: The structure type is defined simply tell the compiler how to represent data, but it does not let the computer assigned space. Definition of a structure is generally not allocated memory is declaring a structure variable memory allocation.

Guess you like

Origin www.cnblogs.com/ABClazyboy/p/12595068.html