Use this tag for questions related to declare, which is usually meant for declaring variables, statements, etc.
Questions tagged [declare]
736 questions
-2
votes
1 answer
Declare variables in Microsoft Visual C++?
Where should i declare the variables i like to use in windows forms?
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
int iMyvariable = 1;
}
private: System::Void button1_Click(System::Object^ …

imi007
- 23
- 2
- 5
-2
votes
1 answer
how to create view with variables inside?
i have some code here but first i want to explane my question.
i want to create a view but thats not possible in a view because my SELECT statement hase some variables in it i have seen some answers with function but i dont know how the parameters…

Jeroen
- 269
- 2
- 3
- 13
-2
votes
1 answer
How i can to declare putStrLn or print in Haskell
my answer is:
How can i declare print in function?
bisiesto :: Int -> **?**;
bisiesto x = if (x `mod` 4 == 0 && ((x `mod` 100 /= 0) || (x `mod` 400 == 0))) then print("Es bisiesto") else print("No es bisiesto");
Please, who can i help me? Thanks.

jordiAnd
- 127
- 1
- 1
- 8
-3
votes
4 answers
How to declare arrays in python3
I want to declare an array in python3. I tried but I got an error
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ip_pb=[]
>>>…

Janith
- 403
- 6
- 14
-3
votes
2 answers
what is the problem with declaring a variable bounded by a parameter in the function itself rather than in the main function?
I have been trying to include the declaration of the variable in the function itself but it doesn't work unless I include it in the main function. Why does this happen?
#include
using namespace std;
function1(int x)
{
int x =1;
cout <<…

Kragon
- 15
-3
votes
1 answer
variable cannot be resolved to variable inside loop
I've written the following Java in attempt to find primes less than 1000:
public class primes {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("2");
int n=2;
While…

vap
- 151
- 1
- 2
- 9
-3
votes
1 answer
' ' was not declared in this scope
I'm new and I really can't understand the meaning of "not declared in scope" error. I tried declaring these as functions and also by using "" to show a function but it did not compile and run. Here are the errors:
In function 'int main()':
[Error]…

Kshitij Domadia
- 23
- 1
- 4
-3
votes
2 answers
Declare variable inside String.format in c#
How can i declare a variable inside String.format and use it again like :
String.Format("{0} {1}", int t = 1, new string[] { "a", "b" }.ElementAt(t));
update
I just want to learn something new and type the code in one line.
It is not necessary in…

Ahmed Aljaff
- 149
- 2
- 10
-3
votes
1 answer
Error while using declare for type restriction in PHP7
I am currently practicing PHP7 with small code. I was using this code to practice scalar type declaration:
declare(strict_types=1);
function div(float $x, float $y)
{
return $x / $y;
}
function sub(int $x, int $y)
{
return $x -…

Ahmed Khan
- 518
- 4
- 12
-3
votes
1 answer
Declare a Bitmap with the name of the resource in a string
I want to declare a new Bitmap but i have some names for the image, R.raw.XXXXXXX,
and i dont want to create a terrible switch with all the posibilities... any idea?
for example:
Bitmap bitAnimal = BitmapFactory.decodeResource(getResources(),…
-3
votes
1 answer
SQL: How Do you Declare multiple paramaters as one?
I am attempting to do the following
1. Link two tables via a join on the same database
2. Take a column that exists in both FK_APPLICATIONID(with a slight difference,
where one = +1 of the other I.e. Column 1 =1375 and column 2 = 1376
3.…

Denslat
- 169
- 2
- 12
-4
votes
3 answers
Error declaring in scope
im having some trouble completing one of my assignments for my intro coding class. i keep getting the error when compiling, "[Error] 'displayBills' was not declared in this scope. I will attach my code, any suggestions would be greatly appreciated,…

Kole Gemmell
- 35
- 4
-4
votes
3 answers
Error with Declare usage
I would like to learn how to use declare.
My query is like:
declare @iter int
set @iter = 1
error:
Msg 137, Level 15, State 1, Line 1
Must declare the scalar variable "@iter".
Please help!

user2565838
- 1
- 2
-5
votes
1 answer
Does repeatedly declaring in a nested for loop slow down a program?
With a nested for loop like:
for (int i=0; i

Mike Mendizabal
- 11
- 1
-6
votes
3 answers
Can i declare a variable in Javascript like this?
Can i declare a variable like below?
var new_result_data_flag-- =1;
its giving error of ReferenceError: Invalid left-hand side in assignment.

Santosh Kumar Sahu
- 27
- 7