Home > Back-end >  Blue cup practice
Blue cup practice

Time:01-03


Octal, hexadecimal, my train of thought is first converted to a decimal, again into octal, your compiler (DevC++) can be compiled, but blue bridge practice system shows the compile errors, give advice or comments please bosses!

CodePudding user response:

Error message is very clear, so long as you to initialize the array b,
The definition of a variable length arrays is run-time initialization is a compile time, so write code like bachelor's elder brother to reserve a wedding dress ~

CodePudding user response:

The compiler does not support for C99, or is not enabled by default

CodePudding user response:

Upstairs positive solution, compile time should be added: - STD=c99

CodePudding user response:

Not so well,
If you don't support for C99, so should not be such a error message,
In fact variable-length arrays cannot initialize the C99 said,

CodePudding user response:

reference 1st floor forever74 response:
error message is very clear, so long as you to initialize the array b,
The definition of a variable length arrays is the run-time initialization is a compile time, so that writing code is like bachelor's elder brother to reserve a wedding dress ~

But I don't initialize array b, I need to use it in here?

CodePudding user response:

Writing your own assignment, or memset will do ah,

CodePudding user response:

Initialization, also called initialization, English the initialize, and assignment is not matter,
C it is a compile-time action,
And C99 variable-length array to determine how big is it until run time, on the other hand is to compile time don't know how big is it, therefore cannot initialize compile time,

This is why global array, the static local array cannot be longer, just because they have the default initialization actions at compile time,
Logical, have common local array initialization actions also cannot get longer,
  • Related