Most voted "variables" questions
A variable is a named data storage location in memory. Using variables , a computer program can store text numbers, binary data, or a combination of any of these data types. They can be transferred in code, to other functions and even other applications.
Learn more…645 questions
Sort by count of
-
2
votes1
answer993
viewsCopy the value of a list variable to a python variable
I’m declaring a variable X with the value of another Y using =, but when having do a append in the variable X, to Y also changes. Code: ''' Resultado obtido: ['casaRJ', 'casaSP', 'casaDF', 'apRJ',…
-
2
votes2
answers84
viewsHow to get the name of a variable as a string in Go?
Is there any way to get the name of a variable in Go as string? var progzila int As I could get variable name above, it is possible?
-
2
votes2
answers172
viewsInitialize variable in a "for"
I remember that in C language I didn’t need to initialize the variable (in case i) with a value, I tried to do the same on C# and got a build error. In C# I am required to set the value of the…
-
2
votes1
answer126
viewsHow does the life cycle and visibility of the Flask object work. g?
In Flask there’s an object called g or Flask.g that according to the documentation is used for data storage. And this object is used when assigning something to it. For example: def get_db(): if…
-
2
votes2
answers59
viewsReturn the typed name
The program only returns the first letter of the typed name. I think it has something to do with the "%c", but I still don’t understand how this formatting works or maybe the data types in C.…
-
2
votes2
answers257
viewsRange of variables in C
I could never understand the question of the range of variables, I know that each one occupies a certain space in memory, but what does the interval mean? When I say a variable char assumes values…
-
2
votes0
answers208
viewsA var, or Let or const has performance difference for several?
I have seen numerous answers that say it’s just a matter of style, which is good practice due to Hoisting, but I wanted to know numbers (I don’t know how to get them) on the performance aspect.…
javascript variables performance variable-declarationasked 4 years, 11 months ago Paulo Rogério da Silva 54 -
2
votes1
answer81
viewsHow do I print the name of an instance in Python?
class Panzer(): def __init__(self): self.life = 100 self.blin = 100 drogo = Panzer() cabal = Panzer() sirius = Panzer() group = [drogo, cabal, sirius] for i in group: print() What should I put on…
-
2
votes1
answer53
viewsWhy do different types of variables give different results when modified in a function?
I can’t understand why x and v[0] are different. void edit1 (int x) { x = 9 * x; } void edit2 (int v[]) { v[0] = 9 * v[0]; } int main () { int x, v[2]; x = 678; edit1 (x); printf (" x: %d\n" , x);…
-
2
votes1
answer164
viewsIn what order to dispose the methods of a Java class?
In which order to dispose the methods of a Java class? Whereas a class can have: constructors, static methods, private methods, public methods, abstract methods. For example: public class Classe {…
-
2
votes2
answers98
viewsHow to create a program that checks the entry of a variable and only proceeds until it is valid (Type - Value)? Python
How to create a program that checks the entry of a variable and only proceeds until it is valid (Type - Value)? Python In this case I created a function to check if a value and number and returns…
-
2
votes3
answers105
viewsHow to change the value of a variable with a function?
var x = 2 function alterar(x) { return x += 2 } alterar(x) console.log(x) console.log(alterar(x)) Why the variable x doesn’t change the value? It only changes when I call the function, but then it…
-
2
votes1
answer199
viewsWhat is the difference between "value types" and "Reference types"?
I didn’t quite understand these classifications among the types that a variable can contain that are value types (types of value) and Reference types (reference types) that exists in the language…
-
2
votes1
answer115
viewsHow to remove double quotes from the beginning and end of a Dart variable?
Speak devs, all right? I am unable to remove double quotes from the beginning and end of a Dart variable. I post to my Web API and receive a JWT Object. I only need the value of the object, without…
-
2
votes1
answer32
viewsInitialization of variables in Java
Good night Folks! I’m learning java, and if you can help me with that question,... I saw it in a course that I’m doing, in a book that I’m reading, and on websites where I researched this assuming…
java variables typing initialization programming-principlesasked 3 years, 5 months ago Tarcio Vinicius Nieri 73 -
1
votes2
answers674
viewsCan you use a variable that’s inside the for?
For example. I am working with Heredoc and whenever I need to do a for, I have to close Heredoc to do the for then open the mentioned tag again. Is there any way to query a variable within the is…
-
1
votes1
answer566
viewsLoad Gridview with variable data
I have 3 variables whose values are changed within a loop for. What I’m trying to do is take these values that are obtained from the variables and load them into a Gridview. Here’s what I tried to…
-
1
votes2
answers420
viewsHow to remove a variable from memory?
How to remove a variable, not necessarily from the code, but from the memory/record, in C? Hypothetical example: char meu_byte; //codigo deleta_da_memoria(meu_byte); That generates something like:…
-
1
votes2
answers2266
views -
1
votes2
answers327
viewsIf condition in variable
I have a variable called Lastclass, it can have the value of headerSortDown or headerSortUp. I’m rescuing her from an orderly column. I want to transfer this variable to a <a href> but wanted…
-
1
votes1
answer353
viewsUndeclared variable
You’re making a mistake on lines 118,127,133,139... 127 20 'vector' was not declared in this Scope #include<stdio.h> #include <stdlib.h> #include <string.h> #define tamanho 5 int…
-
1
votes2
answers80
viewsError trying to define or read the value of variables already defined - System.Nullreferenceexception
I’m having trouble with this code. Whenever it rotates, it causes an exception of the type System.NullReferenceException. // Clear out the Array of code words wordBuffer = null; Int32 syntaxCount =…
-
1
votes1
answer82
viewsUnexpected result in C program
In that code: #include <stdio.h> #include <stdlib.h> int main() { int x, y = 10; //incrementa depois atribui y = ++x; printf("x = %d\n", x); printf("y = %d\n", y); system("pause");…
-
1
votes1
answer543
viewsVariable reading in C with timeout
Does anyone know how to limit the time the user can enter a value? Example: My program prints a value on the screen and the user has 4 seconds to type and enter, if what he typed is = to the printed…
-
1
votes1
answer1145
viewsWhat is the difference between Int32 and int in C#?
In C#, use String or string, Int32 or int, among others, there is no difference, in thesis. Anyone knows if this difference generates any impact on the performance of high complexity applications?…
-
1
votes3
answers1813
views(Javascript-jQuery) Variables within variables giving "Undefined"
Hello. I have this code that is failing to capture this variable. HTML, attempt 1: <html> <head> <meta charset="utf-8" /> <script src="js.js"></script> <script…
-
1
votes3
answers1212
viewsWhy can’t we destroy [using unset in] a static variable?
I was doing some tests with static variables of a class and I came across a Fatal Error. Behold: class Stack { public static $overflow = 'english'; public $user; } Stack::$overflow = 'portuguese';…
-
1
votes1
answer70
viewsHow to include dateInterval property within a variable
After getting the time difference between two fields input time (vine this question), I don’t know now how to put these values within variables, so I can use them in other functions. The var_dump of…
-
1
votes1
answer608
viewsError when calculating time difference with Datetime after 00:00
I’m having a problem figuring out the time between two times with the datetime when the departure time is between midnight and 1 a.m.. For example, if the first time is 14:00, and the second time is…
-
1
votes1
answer828
viewsCounter variable PHP
Good staff, I have a form in a file PHP to fill a leaderboard. And wanted my form asks itself something like, "Athlete’s number in the ___" position, where the number of the position in the __. For…
-
1
votes1
answer6725
viewsPHP - How to insert a variable link into a variable href?
I’m trying this way: <?php $link = "'index.php?id=echo ['post_id']; " ?> <?php while ($row = mysql_fetch_array($result)) { echo "<span class='survey-name'><a href='$link'>".…
-
1
votes1
answer494
views -
1
votes3
answers3092
viewsHow to make an integer store a 12-digit number?
I need to find the largest prime factor of the number 600851475143. Because it is a very large number, I cannot store it in a normal integer type variable. The code I made to find the largest prime…
-
1
votes2
answers198
viewsHow to create variable to contain a number with millions of digits?
I saw a report about the discovery of a prime number that contains 22 million digits. How could a variable contain a number, for example, with 100 million digits.
-
1
votes1
answer2018
viewsHow to transform numeric variables into strings in R (0=NO and 1=YES)?
1I have a datasheet where 0=No and 1=Yes. When I try to create a table of this variable appears the following: ] How do I make the function prop.table a the pie function of the pie chart recognize…
-
1
votes3
answers771
viewsHow to put two $Row results into variable?
The code below gives error, it does not add the results of $row, only the comma and the dot. What to do? Code that doesn’t work mysql_select_db('cadastro',$conexao); $sql="select * from usuario";…
-
1
votes2
answers112
viewsHow to pass post variables, save them until the last step and show all values
I have a form that is divided into 10 parts, IE, I will save via post the variables from page to page. However, if you refresh on the page all previous variables are lost. How can I solve the…
-
1
votes1
answer120
viewsHow to perform an operation without showing the result in C?
I need a way that the program performs an account between variables x and y and save the result in a variable z, how do I do it in C?
-
1
votes1
answer35
viewsHow can I use a Less variable to give the source address?
In my file Less I have a variable called @address with the main address where the fonts are, I have several fonts and need to put the directory in all with this variable, but it does not work. One…
-
1
votes2
answers2955
viewsCapture field value by its ID and turn into a variable
I want to take the value of a field from my table and turn it into a variable. Example: <td id='exemplo'>VALOR EXEMPLO</td> want to take the content and turn it into a variable using…
-
1
votes1
answer1698
viewsAssigning values to dynamic variables
I’m trying to write a code that downloads the historical stock price series from yahoo Finance, then I need to separate the data. I want each variable to be named after the action. For example: I am…
-
1
votes2
answers276
views -
1
votes4
answers1821
viewsString and variable concatenation problem in jquery load function
Follow the full Javascript code: var idcl = document.getElementById('idcl').value; $(document).ready(function(){ $('#estados').change(function(){…
-
1
votes3
answers410
viewsSend variables to PHP via Ajax - undefined variables
I’m trying to send data from one PHP file to another via Ajax, but the variables are going undefined (in Alert, it displays: "Notice: Undefined variable:"). A brief description of the structure used…
-
1
votes2
answers1756
viewsC# Challenge Variable value exchange
I recently made a very simple challenge : Swap the value of two variables without using a third variable. int a = 5; int b = 3; a += b; // a = 8 b = a - b; // b = 5; a -= b; // a = 3; It is simple…
-
1
votes1
answer622
viewsHow to receive a variable within the php URL
I’ve had a problem for two days that I can’t decipher. I need the login and password variable passed in my system login form, to reach the url that receives the user and password parameter. This way…
-
1
votes1
answer405
views -
1
votes2
answers416
viewsItem chosen in Spinner be a global variable
Good afternoon, everyone , I have an Activity that has a Spinner , the value chosen in this Spinner is sent to another Activity in which I do getIntent and receive the value of Spinner , my doubt…
-
1
votes1
answer146
viewsKeep variable value between layers of a function
I wanted to make a site where when I click on the image it doubles in size and width, but can do this only once, and if I do more, a warning appears preventing it. Similarly, if it is the default…
-
1
votes1
answer52
viewsError declaring variable in login system
I am making a login system and now I come across a "Notice" that indicates that my Variable is not defined. This variable is not informed by the form. It is defined by a function that will generate…