Home > Back-end >  Can let a symbolic constant value initialize a variable value
Can let a symbolic constant value initialize a variable value

Time:10-07

For example,

int a;
Cin & gt;> a;
Const int x=a;

Please god 犇 teach

CodePudding user response:

Hey, is this constant assignment, please

Can the

Only after x assignment as I could

CodePudding user response:

The
reference 1 floor? Victor.?? Response:
hey, is this constant assignment, please

Can the

Only after x can no longer assignment
that it can realize variable length arrays, int arr [x];

CodePudding user response:

Of course can't

They are not the same thing

Variable-length array should only apply to dynamic

CodePudding user response:

The
reference 3 floor? Victor.?? Response:
of course can't

They are not the same thing

Variable-length array should only apply to dynamic
but I remember the length of the array can be a symbolic constant

CodePudding user response:

Const int x=5;

Int a [x];

This is possible, or the equivalent of int a [5], and no longer realize

But the int a;

Cin> a;

Const int x=a;

Int arr [x]

You can't

CodePudding user response:

Of course,

The compiler version, standard

May have a deviation

But most should still won't do

CodePudding user response:

The
refer to 6th floor? Victor.?? Response:

of course
The compiler version, standard

May have a deviation

But most should still won't do
los valley can seem to be on top
  • Related