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
-
0
votes1
answer187
viewsDifferent global variables that when one is changed change the value at all
I have a class responsible for managing certain call variables clusters, these are a vetor de vetores yesterday contains a word and an associated value. But every time I make an adjustment to the…
-
0
votes0
answers37
viewsVariable value increases +1 within Thread
I am trying to change the color of the Datagrid line and this is easy. However, something is happening with the variable value idxRow2 when this is accessed in the new Thread. The problem is in the…
-
0
votes1
answer115
viewsRead multiple variables in the same line (Scala)
I need to read three variables in the same line in Scala, I read an answer in English but the method did not work, "readline" and "toInt" are not recognized. Follow my code. If anyone knows a way…
-
0
votes1
answer262
viewsVariable in a url by powershell
I’m building a script that takes an answer from a url and uses this answer to build a second url. Example: $id = Invoke-Webrequest -Uri "http://meusite/login? blablabla" This first request will…
-
0
votes0
answers411
viewsJava Beginner Doubt - Why is the result of the double variable wrong?
I made an algorithm that simulates a bank account, where the client can withdraw and deposit values, worked perfectly when I used variables like int, but when I use double type variables (in order…
-
0
votes1
answer655
viewsStore app.post nodejs request data
Speak people, I would like to know how I can use the data received from the page to use outside the app.? var SerialPort = require('serialport'); var Readline = SerialPort.parsers.Readline; var…
-
0
votes1
answer30
viewsDifficulty deploying multiple options in a conditional variable to load corresponding image
like every programmer... it’s 1:30 in the morning.... That’s us.... Friends can’t make a conditional variable work... someone can give me a light....? <?php $variavel_condicional =…
-
0
votes2
answers382
viewsreset variable increment javascript
what I need seems to be very simple but I haven’t found a solution yet. I have that code var countID = 1; $("#addArma").click(function (e) { e.preventDefault(); var tipoCampo = "arma";…
-
0
votes1
answer143
viewsError: a property or an indexer that cannot be passed as an out or ref parameter
I’m having second thoughts about CS0206 Error Maybe a property or an indexer cannot be passed as an out or ref parameter on line 39 and 41 of my code, how do you solve this? 35| produtos[i] = new…
-
0
votes2
answers299
viewsHow to use a variable to delete with like? SQL Server
I’m having trouble developing the T-SQL below: DECLARE @NOME_FILIAL VARCHAR(25); DECLARE @DATA_AJUSTE DATETIME; SET @NOME_FILIAL = (SELECT FILIAL FROM FILIAIS WHERE COD_FILIAL='125518'); SET…
-
0
votes0
answers46
viewsProblem to create Database with Mysql variable
I have a problem to create a database in Mysql. The term is as follows:. CREATE PROCEDURE trata_busca() BEGIN DECLARE excessao INT default 0; <--- LINHA QUE ESTA APONTANDO PROBLEMA DECLARE…
-
0
votes1
answer38
viewsVariable is not found in an operator method
I’m studying operator overload but my code is not compiling. #include <iostream> using namespace std; class Complexo { public: int real, image; Complexo(); Complexo(int r, int i); Complexo…
-
0
votes1
answer70
viewsSum does not present the expected result
I created a simple calculator with HTML5, CSS and Javascript. However, when I calculate, the value of the first field is added to itself, and not to the second field. Therefore, when I perform the…
-
0
votes1
answer96
viewsAssigning values to repeating variables
I was doing an exercise on the Fibonacci sequence and I was quite confused by the question of assigning values to variables within repetitions. I found a solution as if by luck and ended up not…
-
0
votes1
answer234
viewsHow to change the color of the $ symbol of the PHP variable in a theme installed in VS CODE
someone knows how to change the color of that PHP variable symbol, the dollar sign ($). I’ve searched and found nothing about it, nor in the documentation.
-
0
votes2
answers932
viewsHow to store values of a list in individual variables without knowing its size?
I need to assign each integer value within a list of at least 1 item and at most 10 items to a separate variable. Then decrease 1 of each item, add them and print the result. These numerical values…
-
0
votes0
answers24
viewsShell - Enter or put program into variable
I have the following code: for (( c=1; c<=10; c++ )) do cc stringalea.c -o st aux = ./st $c echo $aux ... done The stringalea. c program returns a pseudo-random word of length "c". How do I enter…
-
0
votes0
answers1760
viewsPostgres using variables in SELECT
In Mysql we can do: SET @pedido = 123; Afterward: SELECT @pedido We have something like that in postgres? I have looked on the web, but only found in the construction of functions and procedures The…
-
0
votes2
answers53
viewsHidden value of variable
When I put to show the numbers that were exchanged the program just shows nothing, I do not understand why. Read two numbers by storing them in the variables num1 and num2. Check if the value of…
-
0
votes2
answers887
views -
0
votes0
answers19
viewsError with multiple IF conditions
The if only proceeds if it’s’m' the person’s sex, if it’s the others with || that I put will not, can anyone take away this doubt? char sexo; float altura, pesoideal; printf("Qual o sexo da pessoa?…
-
0
votes1
answer37
viewsVariable assigned to another parent variable
Hello, I’m having a problem with Python3: When I create a list and assign the value of another variable to that list, when I change the variable the list is changed, code: lista = ["uau", "nossa"]…
-
0
votes2
answers127
viewsUpdate variable values on repeat loop
I ran a simple cash-and-deposit operation code on a variable. The code works and meets withdrawal and deposit operations normally, it happens that when I want to do a new operation, the value that…
-
0
votes0
answers51
viewsIndefinite Variable / Callback in javascript Accountaddress
I am facing a problem in my project: Ultimately it is as follows: My local variable is not being set even if it is set. is Callback problem, how can I solve? I’ll explain the situation further…
-
0
votes1
answer58
viewsHow to use javascript to perform math operation
I have the following relationship How do I create a javascript code that counts decimals? For example... if I measure 5.7cm? The account that would be: subtract 110 from 145 and the result divided…
-
0
votes1
answer50
viewsArray size set by variable
I checked and I see no mistakes. void exibe (int * , int); int main(){ int n; int m[n], i; printf("Digite o numero de elementos do array : "); scanf("%d",&n); for (i = 0; i < n; i++){…
-
0
votes1
answer40
viewsmodify Python variable value
I need the value that is written in the variable "add_money" to be added and added in the variable "balance" saldo = 0 op = input('O que deseja fazer? ') if op == 'add': add_money = int(input('Qual…
-
0
votes2
answers194
viewsHow to detect when the user enters something invalid or wants to terminate the program first?
I was doing an exercise in C++ that takes the smallest and the largest number typed by the user, I tried to leave something more automatic, where he goes typing until he doesn’t want more. So I’m…
-
0
votes1
answer67
viewsGlobal variable does not change the value
I’m a beginner and I don’t know why this code doesn’t work. Can someone tell me why? def teste(): global res1 res1 = input().strip() if res1 == '1': print('funciona')…
-
0
votes1
answer55
viewsHow do I concatenate two variables to form a sequential variable
<?php error_reporting(E_ERROR); session_start(); $var_quant = $_SESSION['quantvend']; $var_varejo_atacado = $_GET['varejo-atacado']; $con = mysql_connect("localhost","root","");…
-
0
votes2
answers102
viewsFormat a double of a variable with two houses
I have a number in Double coming from an object (think) and will be displayed in a table abstractTable. I would like it to be displayed with only two houses after the point. My code below: public…
-
0
votes2
answers33
viewsCheck whether a variable created through exec() exists
Good evening, create an excerpt from a script that performs the creation of a variable through exec(), however, how can I verify that the variable exists through a for in range? # criando a…
-
0
votes1
answer43
viewsIs it possible to call members of a Dynamic class as a string?
using System; public class Program { public static void Main() { dynamic stud = new Student(); Console.WriteLine(stud.Name); } } public class Student { public string Name = "John"; } Output John Is…
-
0
votes1
answer92
viewsI need to initialize the variable with the value 0, why?
import java.util.Scanner; public class Main { public static void main(String[] args) { int codigo, quantidade; double preco; Scanner sc = new Scanner(System.in); codigo = sc.nextInt(); quantidade =…
-
0
votes2
answers82
viewsHow to store different values in a single variable
I wanted to take a variable and store different values. In this case, it would be 7 ages, how to do? cont = 0 anos = 0 for c in range(1, 8): cont += 1 anos = int(input('Em que ano a {} pessoa…
-
0
votes0
answers32
viewsBucket Sort C help me
Good afternoon everyone, I would like to thank you first because you have already helped me a lot, but I need your strength again. I have a work in which I must use the ordering method Bucket Sort…
-
0
votes1
answer34
viewsUse variables to define an object or not?
Recently watching some tutorials, I see programmers omitting the variables in code block. I don’t know what this practice is called, but I wonder if it is recommended, what are the advantages and…
-
0
votes2
answers313
viewshow to make this variable have a double value #Dart
If anyone can give me a detailed description, thank you, I’m new to the language import 'dart:io'; void main(){ var saldo = 100; print(' '); print('gostaria de sacar dinheiro?: (y/n)'); String…
-
0
votes0
answers46
viewsVariable "forgets" that has been assigned to the other and function returns Undefined
function pegarBotaoClicado (botoes) { let botaoClicado botoes.forEach(botao => { botao.addEventListener("click", function (e) { botaoClicado = botao }) }) return botaoClicado } In this function I…
-
0
votes3
answers87
viewsIn the Kotlin language, how to access a public variable that is in one class, through another class?
WHAT I DID: I created a class in android studio and I did it using Kotlin, and within this class I created a "public" variable like string, asseguir: var variavel_de_tipo_public_string : String =…
-
0
votes0
answers16
viewslocal error variable
g = 10 def b(): g = g + 1 b() When I do this error appears UnboundLocalError: local variable 'g' referenced before assignment I can’t put the g variable inside def b() For every time I call b() she…
-
0
votes2
answers40
viewsHow to pass the value of a variable char to another char in C
My doubt is how I successfully pass the text from one char variable to another also char? I’m trying the following: salva_nomeMaior[30] = dados[i].nome; The variable that is with the text that is…
-
0
votes2
answers225
viewsUpdate the value of a variable for the result of its sum with +1
I have a variable that is a number, I want to update its value when the button is clicked... But I want to update the value with sums, for example: the variable value is 0. But when the button is…
-
0
votes2
answers299
viewsHow to pass a variable from one Javascript file to another?
I’m a beginner in Javascript and decided to try a Memory Game to test my skills. My idea is the following: make an HTML page that will be the menu (where players will insert the names and the script…
-
0
votes2
answers68
viewsI’m learning JS and was testing functions and have a doubt
I was testing Function and wanted to make it detect ! of a message: //Detector de ! function detector(){ var detector = txt.indexOf("!") if(detector>-1) return true } //reponder a mensagem…
-
0
votes1
answer28
viewsSubstituting and displaying parameters in PHP
I’m creating a coder, a personal project to apply knowledge and learn more. The coding part is working, but the decoding part isn’t. I execute and nothing appears. Could someone help me find the…
-
0
votes1
answer146
viewssend the value of a variable from one program to another - python
Good afternoon. I am making a program in python that will use the numeric keys to open applications and(or) websites. I created 2 codes: 1 to configure (set the links that the user will want to…
-
0
votes2
answers66
viewsPython - Create dynamic variable for firebase
I have a code that you receive from a spreadsheet CodProduto, Descrição and Quantidade and then inserts them into the database. Only it does this 1000x looping. How can I create variables with this…
-
0
votes1
answer70
viewsVariable value is changing automatically
I have a question about assigning values to variables. I created the following code for solving equation systems by the Gauss-Jacobi iterative method: A = np.array([[2., -1.], [1., 2.]]) # Matriz de…
-
0
votes0
answers35
viewsHow to filter om php variavaeis javascript?
I have a social network and want to put php filters to prevent q lines of code being posted by changing the site. The code that redeems the text when the user presses the publish button is:…