Home > Back-end >  My trouble which the great spirit and me about the following warning is what mean? Why do I feel wit
My trouble which the great spirit and me about the following warning is what mean? Why do I feel wit

Time:04-03

CodePudding user response:

To an array of a specified a length, such as char [32] a.

CodePudding user response:

First, the second parameter should be inside the scanf a, rather than & amp; A, didn't show the problem, because it "values" are all the same to the two address values, but they are different types, disorderly use is a very superficial mistake,
Secondly, not a given length, uninitialized array and not given length, this should be a error,

CodePudding user response:

Both problems cannot be ignored, don't cry because it is not to see the consequences,
Is omitted discomfort caused by stern readers of one hundred and fifty cross,

CodePudding user response:

reference 1st floor QZJHJXJ response:
to array a specify a length, such as char [32]. "

Must specify length

CodePudding user response:

refer to the second floor forever74 response:
first, the second parameter should be inside the scanf a, rather than & amp; A, didn't show the problem, because it "values" are all the same to the two address values, but they are different types, disorderly use is a very superficial mistake,
Secondly, not a given length, uninitialized array and not given length, this should be a error,

Pal and I have three questions:
1, & amp; A and an accident a address values are the same?
What's the difference between the 2, character array and string?
3, the address is in % s format character array first address, can print out the entire character array, what is this?

CodePudding user response:

In CSDN BBS search under "character differences and relationship between arrays and strings".
The scanf () function usage, under reference: https://blog.csdn.net/luxuejuncarl/article/details/1576513

CodePudding user response:

1, as a one-dimensional array name, a and b & amp; A for the address of the same value is inevitable, not by accident, but more importantly, they also have the difference, the white horse's back are not necessarily the monkey's teacher,
2, a string, it is the specific grammar concepts, the entity structure, began on a first address and end in code value of 0 characters, with the first address, said at the same time its grammatical meaning is mostly the first address, the container can be put into a character array, also can not put,
Character array is each element occupies 1 byte array, which can be used to store the string can also be used to store is not a string,
3, see above, % s reference to the first address, print string, happened to the string in the character array, watching as printed character array,
  • Related