Coding doubt in serial monitor

Sir, what do you mean by minimum scope?

The scope of a variable is the context and extent it can be "seen" in a compilation unit.

You shouldn't give a variable greater scope than is necessary to fulfill its function.

Yes, I understand your point.
But when a variable is declared inside the loop function, since the function is executed infinite times, the variable gets declared each time, so why not declare it in the set up function?

Because then it won't be in scope in the loop function.

Bureaucratic jargon!

You mispelled "linguistic"

From this Dictionary:

Ok, got it!! Can we declare the variable before any function definition?

Jargon may be considered ugly, but it has the advantage of being concise.
(I'm a huge fan of ex-PFC Wintergreen's immortal annotation "Too prolix")

"Bureaucratic" language can only be uttered by bureaucrats - I'm a retired software engineer, sitting in my living room, enjoying the athletics, so nowhere near a bureau.

Good try though.

1 Like

Yes, but then it would have global (or possibly static) scope, which it may not merit.

c strings are terminated with a null, 0, '\0' character. this is used by functions processing strings to know the length of the string.