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
-
1
votes0
answers35
viewsAre there differences in the performance of variables implicitly and explicitly stated?
There are differences in performance of explicitly declared variables? List<int> lista = new List<int>(); And implicitly stated? var lista = new List<int>();…
-
1
votes1
answer123
viewsPrivate variable error in C++
I can’t understand why I’m making this mistake when compiling my code: In file included from test_GenericArray.cpp:2:0: Genericarray. h: In Function ːStd::ostream&…
-
1
votes5
answers210
viewsVariable is not displaying the expected result
On reading the variable at the end to display the value, displays a trash, here is the statement along with my code. Make a program that receives the age, height and weight of five people, calculate…
-
1
votes2
answers718
views -
1
votes1
answer1007
viewsHow to use the content of a javascript variable in another js file?
I am creating my first application with nodejs and have a question in javascript. In the code below I am reading a sensor and saving in variable value every 30 seconds, I wonder if I can use this…
-
1
votes2
answers344
viewsHow to add a PHP variable in Javascript?
I need to play a Volume variable inside a Option that is, the person selects a category and as this category appears the list items in front of the items I need to show the volume, I am unable to…
-
1
votes0
answers78
viewsMethods that return constant values in C and C++ even if they come from variables, is it possible?
In a series of optimizations in a code written in C++ adopted a class to store application parameterization data and some pseuconstants let’s say so. What actually happens is that when the…
-
1
votes1
answer627
viewsVariable inside an array does not work
is a CLOUDINARY image upload system. When I use a fixed value for PUBLIC_ID, it works! $files["remote"] = \Cloudinary\Uploader::upload($sample_paths["couple"], array_merge($default_upload_options,…
-
1
votes1
answer1377
viewsPHP variable storage - $_SESSION x $_GET
Hello friends. I have a question about best practices applied in development: What would be the best form of temporary storage of variables in an application? I have a PHP application where I can…
-
1
votes2
answers764
viewsuse variable cmd command with python
I wanted to make a program that opens and reads a text file. Then run or command on cmd using what he had read in the text file more or less like this: import os nome = open ('nome.txt') nome1…
-
1
votes1
answer64
viewsDoubt about iteration with multiple parameters
This loop performs Log_base_2 of an integer value, at the end the result is available in the variable i. Why make a shift in the form valor >> 1 has no effect compared to valor = valor…
-
1
votes1
answer113
viewsRelation between structs in C
I have the following scenario: typedef struct Unidade{ int cod; } und; typedef struct Produto{ int cod; char nome[100]; und unidade; } prod; As you can see I have a unit type variable inside the…
-
1
votes1
answer321
viewsMore performative way to work with Request in Classic ASP?
I’m working on a web page that uses Classic ASP and I got a question, store the value of a request in a variable improves performance when compared to staying using the request("value") throughout…
-
1
votes1
answer46
viewsValue is not added to a variable within a function
I’m doing a simple quiz show with questions and answers, with punctuation. My problem is this: I made a function so that every time the answer is right, +1 will be added to the score variable.…
-
1
votes3
answers115
viewsHow to access an array and export variables?
I have a code that receives the data via $_POST on a form as follows: ... $certificate = $_POST['certificate']; ... If you make a print_r($certificate) the result is as follows: Array ( ['cliente']…
-
1
votes2
answers3778
viewsReturn the shortest date within Select
I have the following table: CREATE TABLE [dbo].[Crm_man]( [id] [int] IDENTITY(1,1) NOT NULL, [nCRM] [int] NULL, [cliente_CRM] [int] NULL, [item_CRM] [int] NULL, [qnt_CRM] [int] NULL, [descri_CRM]…
-
1
votes2
answers134
viewsHow to know which variables are defined?
Is there a function that returns the name of the variables defined in a Python instance? Something similar to the command who in Matlab that returns the names of the user-defined variables.…
-
1
votes1
answer438
viewsC# Calling an object from a string
I wonder if there’s a way to call an object from a string. Here is an example: public class Butao { public string _Name_; public float _Price_; public Butao(string name, float price) { _Name_ =…
-
1
votes1
answer796
viewsHow to display decimal number - iReport
I’m having unexpected difficulty displaying decimal numbers in iReports, for example if my variable has the following account 180 / 180 it displays me correctly 1 but if it is 162/180 it displays me…
-
1
votes1
answer65
views -
1
votes1
answer333
viewscss variables with values coming from the database
I’m developing a website where I saw myself in need to bring the style(colors) of the database elements. This would be a piece of cake if it were a page because (by relaxo) could write the css in…
-
1
votes3
answers1008
viewsHow to list objects in Javascript
I’m using a variable object exp: var obj = { nome: "Marcos", snome: "Bonado", idade: "314", email: "[email protected]", tellW: "0123456789" }; I want to list the names and content of each object. Is…
-
1
votes1
answer60
viewsParameter name does not match with the variable passed
void countdown(int max, boolean output) { for (int i=max; i>=0; i--) if (output) println(i); } void setup(){ int top = 20; countdown(top, true); } There is something wrong with the syntax/writing…
-
1
votes1
answer949
viewsHow to check the type of elements in a Python list?
I have a list of data, and I need to verify that all elements are integer or string, or any other type of data. It is possible to verify all elements or needs to be one by one? For example: Lista =…
-
1
votes2
answers403
viewsProblems with javascript and google maps API
I’m trying to calculate the distance between these two points but I’m not getting it! I’d like to find out what the problem is. On the console, gives error a 404: distancia.html:14 Uncaught…
-
1
votes2
answers333
viewsSingle variable declaration for scanf
I already know how to declare a variable in the traditional way using the scanf(), but I’m thinking of a way that I can use fewer lines and make the code more organized (that’s what I tried with the…
-
1
votes1
answer85
viewsProgrammatically create variables
There is the possibility to create variables programmatically? Example (this example does not work, it is only to understand the idea): I want to create the variables: $var0,$var1,$var2,$var3 and…
-
1
votes1
answer408
views -
1
votes1
answer66
viewsNota1 and nota2 show errors and do not view storage in the array. Can anyone help? Thank you very much
namespace mediaDe5Alunos { class Program /*faça um programa para cálcular a média de duas notas de 5 alunos, mostrar a média da sala e de cada aluno e um relatório dos alunos*/ …
-
1
votes1
answer6433
viewsPython local and global variables
I have a software that treats dates, written as follows: def EscolheDataInicio(): controle1 = None controle2 = None if controle1 == None: teste = easygui.ccbox(msg="Escolher data início?",…
python variables variable-declaration global-variablesasked 7 years, 1 month ago Bergo de Almeida 181 -
1
votes1
answer299
viewsWhat is the default value of a primitive type variable in C#?
When a primitive type variable is created but not initialized its value is null? Example: public int x; If I don’t do anything with x, which means I don’t assign a value to it, it will be null?…
-
1
votes0
answers27
viewsCould not set variable with fetch_object
I’m trying to make a simple query however, although Phpmyadmin perform the query, when I run the code Apache returns the message: Notice: Undefined variable: rprd in D: xampp htdocs final views…
-
1
votes1
answer1283
viewsHow to take the name of a variable within a method?
I need to access the name of a variable within a method. Example: public class A { public A() { string nameToWrite = "thisdoesntmatter"; B.GetName(nameToWrite); } } public class B { public static…
-
1
votes1
answer133
viewsDefine function result return or method
Editing: A previous function generates a list like this: ['Responsável atual', 'Número do processo', 'Foro de tramitação', 'Data da intimação 05/10/2017', 'Data da ação 15/08/2011'] This is the…
-
1
votes1
answer39
viewsSyntax error: Variable problem inside the IF
My code: DELIMITER // CREATE FUNCTION f_desc (in_preco int) RETURNS INT BEGIN DECLARE fim_preco INT; IF in_preco >= 100 THEN -- aqui fim_preco := format(10 * in_preco/100, 2); ELSEIF in_preco…
-
1
votes2
answers235
viewsReset variable every time you switch to a method
I’m making a simple program that inserts at the first possible position of a vector, a String. This is the code I have: import java.util.Formatter; import java.util.Scanner; /** * * @author…
-
1
votes4
answers365
viewsRepetition for calling variables
I have four variables [t1, t2, T3, T4], and each of them was defined as a string previously. t1 = 'A vida vai ficando cada vez mais dura perto do topo.' t2 = 'A moralidade é a melhor de todas as…
-
1
votes1
answer86
viewscreate variable with @for in scss
Good morning to all!! Guys I need to create color variables in SCSS and I’m doing it as follows: @for $i from 1 to 50{ $corClara{$i}:red; } but I can’t make it work...Koala, when compiling, always…
-
1
votes1
answer906
viewsPassing variable value obtained in one method to another method in Java
The project is a school GED, where there is the main class that makes the connection to database and there is another class to generate PDF files. The issue is that the system comes to extract the…
-
1
votes1
answer201
viewsUse data from a request in a global variable
I’m having a difficulty that I’m sure is simple for you! var request = require('request') var a var b request('https://exrates.me/openapi/v1/public/ticker?currency_pair=eth_usd', function (error,…
-
1
votes1
answer130
viewsHow to create a "trigger" function when a variable changes value?
Watching pygame.Surface.get_rect(), I realize that when I change a variable, for example left, pygame automatically recalculates all class variables (center, right, etc.). I’d like to know how it’s…
-
1
votes2
answers131
viewsLoop logic with for
Consider the Javascript code below. var r = [2, 5, 6, 18, 20, 10, 23, 12, 19, 10]; var s = [1, 5, 7, 13, 18, 21, 10, 25, 32, 17, 3]; var x = [0]; var i; for (i = 0; i <= 9; i++) { x[i] = r[i]; }…
-
1
votes0
answers28
viewsI need an HDF5 Dataset Attribute to be a string
Good afternoon, I’m trying to create some attributes for my datasets, I was able to create the attributes but at the time of setting their values (strings) I’m not getting, I tried several different…
-
1
votes1
answer6638
viewsHandling of variables in HTML
Hello... The world HTLM / JAVASSCRIPT / PHP is totally new to me. As a beginner, I count on your help to develop a small project. Come on... I have an INDEX.HTML page that receives a value via URL.…
-
1
votes1
answer591
viewsStruct declaration and initialization outside the main function in C
I’m playing a little game in C that has the card structure: typedef struct { int numero; int cor; } TipoCarta; A method to put the values in the chart: void inicializaCarta(TipoCarta *carta, int…
-
1
votes1
answer446
viewsR - Create Binary Variable (dummy) value 1 for 50% of the total
Well, I’d like some help, I have these data each column has 100%, first wanted to index from the largest to the smallest and later make use of the dummy variable of value equal to 1 for the species…
-
1
votes3
answers160
viewsUse string to reference variable
I wish to move on to the function execSQL the name of the variable I want to use in base.consulta() and from the string SQL, directly pass the variable to the function base.consulta(), that is, pass…
-
1
votes2
answers71
viewsVariable value in PHP
Hello! I get the variables like this: &a25Item1=01&a25Prod1=00123&a25Desc1=ProdutoAcabadoUm The number will depend on $qtdProd…
-
1
votes2
answers121
viewsProblems with values passed to Static variables with class on the server
Good morning, everyone. I am currently suffering from a problem and cannot find the solution. I have a login system in ASP.NET C# when I do the authentication everything happens correctly only that…
-
1
votes2
answers208
viewsDeclaration of a global array of C structures
I created a structure cliente and the next idea would be to create a array clientes. My idea would be to declare array clientes globally, so that all functions can interact without passing it as an…