Questions tagged [declare]

Use this tag for questions related to declare, which is usually meant for declaring variables, statements, etc.

736 questions
-2
votes
1 answer

'' was not declared in this scope

I wrote this program for the college. The user must input 2 numbers (n,m) and the program must make an array with the size [n,m]. Then the user will fill the array and the program must find the maximum number of the columns and print the minimum of…
-2
votes
4 answers

C++ Getting an error with my functions

Need some homework help. I'm new to C++, and I'm getting an error I don't understand. Here's my code: /* * homework6.cpp * Coder: omega9380 * Final Project */ #include #include #include using namespace std; int…
-2
votes
3 answers

PLSQL Variables

I'm new to programming and I was wonder how I would declare a variable I can use through out my code. What I want to achieve is : Myvariable = (select Column from table1 where column =1234 group by column); select column from table2 where column in…
Oxy111
  • 67
  • 1
  • 7
-2
votes
1 answer

Define an element that points to a same element type in C++

I want to define an element that points to a same element type, something like this: #define Foo { Foo*, ..., ... } For example, this helps me to create a simple tree without creating any auxiliar class: #define TreeNode std::deque(std::pair(char,…
Santiago Gil
  • 1,292
  • 7
  • 21
  • 52
-2
votes
1 answer

C# paste T model class dynamically as variable

I want to store my model class as a variable and use it in all my code dynamically. For example I have something like this: IEnumerable students = GetAllStudents(); Normally I must always declare and retype Student class. But I need to…
-2
votes
3 answers

C++ declaration error

I am currently working with arrays and moving around the data from array to array, however, that isnt the issue the issue is within my void functions more specifically my for loops i dont know why it won't compile when it looks correct to me and I…
Morgan
  • 1
  • 3
-2
votes
1 answer

Fatal error: Cannot redeclare email() previously declared in

I am creating my login page and when I loaded it up I seemed to get this error saying: Fatal error: Cannot redeclare email() (previously declared in /home/a4625512/public_html/core/functions/general.php:2) in…
-2
votes
1 answer

How do I insert the output of these loops into my table?

Declare @PASS char(16) Declare @COUNTER int SET @COUNTER = 0 While @COUNTER < 2 begin select @PASS =replace (replace (replace (replace (replace( …
user1234
  • 21
  • 4
-2
votes
1 answer

Declare Syntax error in Mysql

DECLARE @id uniqueidentifier SET @id = NEWID() When I try to use the above declare to set up unique identifier, I am getting the below error: DECLARE @id uniqueidentifier SET @id = NEWID() Error Code: 1064. You have an error in your SQL…
jack
  • 1
-2
votes
2 answers

Qt declaring member names using a loop

I need to work with 512 individual rectangle items in Qt which I am implementing in a QGraphicsScene. I don't really want to declare all 512 elements manually unless I really have to. At the moment I have something like: QGraphicsRectItem…
Mitchell D
  • 465
  • 8
  • 24
-2
votes
2 answers

Declare scalar variable SQL

My problem is i want to use this local variable inside my update query, is there a way of doing this? DECLARE @listStr VARCHAR(MAX) SELECT @listStr = COALESCE(@listStr+''',''' , '') + cast(int_guid as varchar(max)) FROM ex_in SELECT…
Girre
  • 47
  • 1
  • 9
-2
votes
1 answer

How can I declare cookie

I am trying to make this code work fine as i can but i couldnt,i am using cookie and i want to rebind my ListView depending on cookie Location but i am getting error message: "Must declare the scalar variable "@Location"." protected void…
Wiliam J
  • 17
  • 6
-2
votes
2 answers

How do I declare an array in bluej?

private Piece[][] board; public cboard(){ this.board = new Piece[8][8]; } public boolean isEmpty(int x, int y){ boolean empty= true; if (board[x][y] != null){ empty= false; } return empty; } …
user3742283
  • 1
  • 1
  • 1
-2
votes
2 answers

declaring a big list of variables

I have a big list of variables: $variable_1 = $_POST['variable_1']; $variable_2 = $_POST['variable_2']; $variable_3 = $_POST['variable_3']; $variable_4 = $_POST['variable_4']; ... .. . $variable_86 = $_POST['variable_86']; What would be the best…
bryan
  • 8,879
  • 18
  • 83
  • 166
-2
votes
2 answers

PHP: using a switch to declare a string. Is this possible?

In the following code: $num = Rand (1,2); switch ($num) { case 1: $var1 = "first value"; break; case 2: $var1 = "second value"; break; } My next part of coding needs the $var1 to be included inside an array of Jobs. Any idea how I would do this.…