Category "constants"

Take function from one file to another (React)

So I'm struggling to pass "polygonNFTs" to another file. I need to find its number to decide give user permission or not. its working in index but not in navbar

How to pass const value from one react js file to another?

I am a little new on react. How can I pass a variable with its value from one react js file to another? File A.js: const [value, setValue] = useState(35) Fil

Use constants in VHDL and posterior synthesis

In VHDL, I know about constants and variables, but at the moment I have only used the integer or std_logic_vector data types with them. In order to analyse and

C++ How to create a constant pointer to a function?

I want to have a class with a constant pointer to a function as a member. However, I'm instead creating functions with constant return values (a strange feature

GCC, constant tables and .rodata

I have a strange problem with gcc and constants and .rodata Let's assume: typedef const struct { const char *a; } data_t; typedef const struct { const dat

What value does the compiler assign to an uninitialised member of a const struct in C?

Say I have a struct typedef that is: typedef struct { int32_t memberOne; int32_t memberTwo; } myStruct_t; I instantiate a const of that type as follows

c++ Best practise when passing in arguments to functions [closed]

So I have read a lot of things about people saying const & is always good as it eliminates copying, and passing by value is a bad idea. Th

pandas: declare a pandas dataframe as a constant

I would like to declare my dataframe as constant, so no matter what operations are happening in a modeule it's values or column names do not change. I know that

What is the temporal dead zone?

I've heard that accessing let and const values before they are initialized can cause a ReferenceError because of something called the temporal dead zone. What

May a compiler store function-scoped, non-static, const arrays in constant data and avoid per-call initialization?

In reading How are char arrays / strings stored in binary files (C/C++)?, I was thinking about the various ways in which the raw string involved, "Nancy", would

RISC-V build 32-bit constants with LUI and ADDI

LUI (load upper immediate) is used to build 32-bit constants and uses the U-type format. LUI places the U-immediate value in the top 20 bits of the destinati

Find address of constant in go

We have written one program by which we try to find an address of a constant. Is it possible to do it like that? package main func main() { const k =

const& , & and && specifiers for member functions in C++

Recently I was reading through the API of boost::optional and came across the lines: T const& operator *() const& ; T& operator *() & ; T

Swift: Global constant naming convention?

In Swift, it seems that global constants should be camelCase. For example: let maximumNumberOfLoginAttempts = 10 Is that correct? I'm used to all caps, e.g

Removal of constant columns in R

I was using the prcomp function when I received this error Error in prcomp.default(x, ...) : cannot rescale a constant/zero column to unit variance I know I

What's the difference between constexpr and const?

What's the difference between constexpr and const? When can I use only one of them? When can I use both and how should I choose one?

const vs constexpr on variables

Is there a difference between the following definitions? const double PI = 3.141592653589793; constexpr double PI = 3.141592653589793; If not, which styl

Declare a constant array

I have tried: const ascii = "abcdefghijklmnopqrstuvwxyz" const letter_goodness []float32 = { .0817,.0149,.0278,.0425,.1270,.0223,.0202, .0609,.0697,.0015,.0077

Why does const have to be added to constexpr for a string literal declaration?

This declaration: char constexpr *const s = "hello"; Fails with this error: g++ -g -Wall -Werror -std=c++17 test.cc -o test test.cc:8:31: error: ISO C++11 d

Proper implementation of global configuration

My goal is to have global constants in a C++ game I'm working on (to represent some graphics info and the like). My current implementation is to toss them all i