When programming in C, is it possible to set a const
with a value of a user-input?
If so, how?
Why not?
void some_function(int user_input)
{
const int const_user_input = user_input;
...
return;
}
int main (void)
{
int user_input;
scanf("%d", &user_input);
some_function(user_input);
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With