A process of setting or re-setting the value stored in the storage location(s) denoted by a variable name.
Questions tagged [variable-assignment]
4336 questions
1
vote
0 answers
Visual Studio C++ Data from CSV File into Variable Arrays
Basically, I want to make a simple function for a larger project, this will actually end up as a Header file that handles all my inventory. Any who, I just want it to be able to read/pull/input the Data from a .csv file format... Or I can even do a…

Leaum
- 33
- 1
- 1
- 7
1
vote
1 answer
What does it mean when saying "to be assigned something"| ASP.NET Core
I was reading a book about Learning ASP.NET Core API when I run to a part saying:
We create a private read-only field _repository that will be assigned
the injected MockCommandAPIRepo object in our constructor and used
throughout the rest of our…

Hossein
- 142
- 10
1
vote
4 answers
How to pass **kwargs parameters to the relevant wrapped functions?
I want to define a wrapper function that wraps up a number of other functions with many arguments and want to use the magic variables in the wrapper function.
For example, suppose I have these three functions:
def function1(ret, ben, period=0,…

msh855
- 1,493
- 1
- 15
- 36
1
vote
1 answer
Initialization and Assignment
I have some 'legacy' code (which I can't change, but need to add on to) that looks something like this:
template T Foo(T& target)
{
//Assign to 'target', but never read from it before that.
//Also, 'target' is going to be a…
PT90
1
vote
3 answers
Does re-assigning a non-function to be a function with set! create a new frame?
The following code is confusing me:
(define (even-or-odd-letrec x)
((lambda (internal-even? internal-odd?)
(set! internal-even? (lambda (n)
(if (= n 0) 'even
(internal-odd? (- n 1)))))
(set!…

J. Mini
- 1,868
- 1
- 9
- 38
1
vote
2 answers
ifelse assignment does not return pre-defined character vector
I cannot figure out why an ifelse assignment does not return the entire object I'm trying to pass.
Below, I look to see if the state of Texas is in a vector of state names (in my actual code, I'm looking up unique state names in a shapefile). Then,…

ltlf653
- 29
- 5
1
vote
1 answer
how do i point multiple addresses to an array of strings in c?
the mission is to separate the string into several fields. each field is limited by ";", cada campo é armazenado num array de strings
Only PTR[0] is correct. I think it's because of the address assignment to *ptr[]. How can i do the correct…

Carlos Mota
- 55
- 6
1
vote
1 answer
Variable not changing onClick
I have read through a lot of different types of solutions here but none seem to be quite what I need.
I am trying to change the variable "currentIndex" when a user clicks the image.
Right now the change reaches inside the onClick function but does…

krichey15
- 591
- 6
- 14
1
vote
6 answers
A method to take a number of types
I currently am working with a constructor which takes in of type object
I am then testing it's type based on instanceof
Public MyClass (Object obj)
{
if(obj instanceof CusClass1){
CusClass1 myObject = (CusClass1) obj;
globalVar1 =…

Will
- 8,246
- 16
- 60
- 92
1
vote
2 answers
Listing parts of a class
I am trying to make a code with a cat, where you are able to buy certain toys and use them. However, whenever I try to list the toys in the "shop," it gives me an error every time. I'm not sure what I'm doing wrong, but it is definitely somewhere in…

RubyNovice22
- 59
- 1
1
vote
0 answers
Why does Python behave like this in nested function calls?
I have 2 functions. The one that's the second one being called, takes a local variable from the first function and modifies it. I would expect this to use copies and not modify the original local variable, but it seems to be modifying…

bru53001
- 121
- 1
- 3
1
vote
1 answer
Confused with references on pointers in C++
The task is to calculate the output of the following source code without a computer, which I would say is "123 234 678 678" because ref1 is a reference on the value of ptr and in the moment where the address of val2 is assigned to this pointer, then…

Elliot
- 37
- 7
1
vote
1 answer
pandas: assigning values back to unknown column
I have a some dataframes whose columns have string values (sentences). each of these dataframes have column names that either has the word 'gold' in combination with other words (e.g, df.columns: 'gold_data', 'dataset_gold',...etc' or has the word…

zara kolagar
- 881
- 3
- 15
1
vote
6 answers
Casting during an if-else statement
I am trying to cast a object during an if - else statement as follows:
if(sourceSystem.equalsIgnoreCase("Src")) {
MO object = (MO) transformer.create(message,sourceSystem,flowName);
} else {
UO object = (URO)…

Will
- 8,246
- 16
- 60
- 92
1
vote
2 answers
Change base class fields in derived class with base class method
I am not sure where I am wrong here, but there seems to be some miss conception from my side.
I have a base class and a derived class and some methods like in this example.
class Base {
public:
int curr_loc;
Base(int…

PySeeker
- 818
- 8
- 12