Home > Back-end >  The scanf statement cannot be used in the C language definition character array?
The scanf statement cannot be used in the C language definition character array?

Time:06-06

CodePudding user response:

A description of the building Lord itself has a problem, how can define the scanf character array? It can give a character array assignment (by receiving the content of the standard input),

The scanf use of the building Lord has a problem, change to the following:

 the scanf (" % c ", & amp; A [I]); 
//or
The scanf (" % c ", a + I);

CodePudding user response:

The
reference 1/f, confident boy reply:
description of the building Lord itself has a problem, how can define the scanf character array? It can give a character array assignment (by receiving the content of the standard input),

The scanf use of the building Lord has a problem, change to the following:

 the scanf (" % c ", & amp; A [I]); 
//or
The scanf (" % c ", a + I);

The first & amp; A [I] surely not ah, a [I] is an array, without quotes

CodePudding user response:

refer to the second floor qq_45674693 response:
Quote: reference 1/f, confident boy reply:
description of the building Lord itself has a problem, how can define the scanf character array? It can give a character array assignment (by receiving the content of the standard input),

The scanf use of the building Lord has a problem, change to the following:

 the scanf (" % c ", & amp; A [I]); 
//or
The scanf (" % c ", a + I);

The first & amp; A [I] must not ah, a [I] is an array, without quotes
myself try talk again
The basic difference is not a problem
Everyone from novices
Basis difference also can't hear into words is wonderful work

In addition a [I] is not an array of

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related