Most voted "variable-declaration" questions
The declaration of a variable occurs when a variable is created.
Learn more…129 questions
Sort by count of
-
1
votes1
answer64
viewsVariable that has a variable in its name
In an exercise: A company wants to know in how many months there was profit, that is, the balance greater than zero. The code for resolution was this: function quantidadeDeMesesComLucro(umPeriodo){…
-
1
votes1
answer420
viewsCan you tell the size of an array in Visualg?
para i de 1 ate array.length faca escreval("Falta ", i, "?") leia(falta[i]) i <- (i + 1) fimpara For example, in Java it is array.length.…
-
1
votes1
answer248
viewsWhy do I get this error on locale. h? [Error] expected declaration specifiers or '...' before Numeric Constant
The error ( [Error] expected declaration specifiers or '...' before Numeric Constant ) is pointed out in the setlocale(LC_ALL, "English"); However, the locale. h library and comma are present and…
-
1
votes1
answer56
viewsWhat is the purpose of the symbol "&" in the declaration of an object?
I noticed that some statements of variables/objects are used * for the statement (thus generating a pointer), but in some cases has the statement using &. const MyClass & my_class =…
-
0
votes2
answers72
viewsOn the creation of variables
I use ZEND 2 and I am in the controller. I created an action to print a field (description) of a table (receipt). The point is that when I connect the controller to the view nothing appears on the…
-
0
votes1
answer35
viewsCode reduction and variable declaration
Good morning. I have 8 different variables with the same functions. However, the functions assigned to these variables are equal. I feel like I’m being repetitive in the code. There is some way to…
-
0
votes1
answer427
viewsTake the data from a select and declare variable
all right? I am very new to programming and have a simple question that I did not find here on the forum. I have this code below the view (codeigniter): <div class="span6"> <label…
-
0
votes2
answers1961
viewsPractical example List and Arraylist
I’m creating a list of Estudantes, but I find myself in the following situation. In point 2 gives me error because it says I have to take the Student inside the List but when I do point 1 is already…
-
0
votes2
answers1476
viewsPrint components of an array in reverse order
I wrote a code to print the components of a array in reverse order. However, it only returns 5 or 6 numbers (at most), even if I have put more numbers in it. #include <iostream> using…
-
0
votes2
answers59
viewsExplanation of how loop variable declaration For/In works
var meusDados = { nome: 'Bruno Coelho', email: '[email protected]', idade: 23 }; var dados; for(dados in meusDados){ console.log(meusDados[dados]); } Why declaring the variable given before…
-
0
votes1
answer1979
viewsI cannot identify the error - |35|error: ’d' undeclared (first use in this Function)|
I am programming in C/C++ and gave an error that I cannot identify it. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> //Função Principal do Programa int main() {…
-
0
votes2
answers51
viewsVariable declaration
I do not know what is the subject of this part of Java, but I did not understand it: Carro carro; I know that when declaring the variable we do: String carro; Why is there such a thing Carro? and…
-
0
votes1
answer125
viewsDeclaring variable with Let
In the following code, why is not returned João while trying this.pessoa? Where the let was declared should go global, or not? let pessoa = 'João' console.log(this.pessoa) //undefined…
-
0
votes2
answers104
viewsI want to understand how the instance variable and the local variable of the parameters works
public Exemplo { private int name; public Exemplo(int name) { this.name = name; } public void setName(int name) { this.name = name; } public int getName() { return name; } } I want to understand how…
-
0
votes0
answers99
viewsHow to make explicit variable type declaration in PHP?
Taking a course on the Internet, I saw the instructor saying that from PHP 4 (he used 3, so did not test) it was possible to make the explicit declaration of type in object attributes as follows:…
-
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
votes1
answer42
viewsHow to create a parameterized variable?
In one exercise I must create a valid number for credit cards "Luhn’s Algorithm". need to create a parameterized variable to avoid using if, but the code gets too big and I want to reduce it I can’t…
-
0
votes1
answer42
viewsHow to insert multiple email addresses within one variable, in SQL?
For example: If instead of just typing an email address in the variable below, I typed 30 email addresses, which I would have to change in my query below? DECLARE @email as NVARCHAR SET @email =…
-
0
votes1
answer166
viewsIs it possible to disrupt an object inside another object?
I know it’s possible to do this with arrays, type one array thus const array = [[['teste']]] const [[[variavel]]] = array variavel // => 'teste' there is some way to do something similar to…
javascript objects variable-declarationasked 4 years, 2 months ago Christopher William Buscoski S 13 -
0
votes0
answers29
viewsDifference between declaring with var or Let in javascript?
Hi, my first post here. I’m starting to study javascript and I came up with a question between when to declare a variable with var or Let. I’ll use a conditional code as an example: let idade = 19;…
-
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
votes2
answers42
viewsHow to obtain the value of the variable outside the function?
How to get the value of var DI out of office? I’m a rookie, and I curled up.. I need to include it in another function but I can’t get the value out of it :( $(document).ready(function () { $.ajax({…
-
0
votes1
answer47
viewsHow to use a variable of an X function in a Y function in Python?
I am a student of the first period of Eng. of Computing I’m having some problems to understand how I could (if possible) use the variable of one function within another, the two being executed…
-
-2
votes4
answers142
viewsVariable value changes in main function
When I declare a function and put the parameter to receive a variable of the integer type, for example, within the main function when I declare the function int param(int x); and then I call the…
-
-2
votes1
answer40
viewsfailed . append attribute when entering list entry - (Python)
I was able to leave my registration in loop that will be terminated only if the user type N or n. After closing the registration the program displays the registration lists and draw list, however,…
-
-3
votes1
answer92
viewsAssign Value to a variable that the user puts C#
I am learning C# (Good at the beginning of learning) and I saw that anything that the user inserts by "Console.Readline();" is considered as a string automatically by Visual Studio, but how do I…
-
-4
votes1
answer419
viewsVariable declaration problem to compile in Code::Blocks
#include <stdio.h> #include <locale.h> #include <string.h> int main () { setlocale (LC_ALL,"Portuguese"); int num,escolha; char nome[20]; printf ("\nDigite seu nome: "); gets…
-
-4
votes1
answer408
viewsWhat is the difference in the declaration of variables using const?
In the ecmascript-6 some features have been added, among them is the const the visa is used in the same way as the visa var, to declare variables. What is the difference between declared variables…
-
-5
votes1
answer314
viewsI want to create a variable with the dynamic name with javascript
To illustrate better, I have one for, and I want for each time I rotate the loop, to create a variable with the NOME plus the for ex index: for(i=0;i<5;i++){ var "variavel+i" = i…