Questions tagged [declaration]

Declaration is the part of the subprogram (procedure or function) which provides the protocol(header), but not the body of the subprogram.

3407 questions
1
vote
3 answers

Problem with object declaration/initialization as a private member on a different class

Sorry if this has been asked before, I can't seem to find anything. I'm not sure how to search for this. I have something like this: class A { private: int x; int y; public: A(int, int); } class B { private: …
rfgamaral
  • 16,546
  • 57
  • 163
  • 275
1
vote
2 answers

error in c language when trying to declare array of strings

I am trying to declare this array of strings(or a 2d character array,i reckon) in c language but the compiler ide is giving me error: "[Error] array type has incomplete element type" char division[][]={"Northeast Division","Northwest…
piku_baba
  • 59
  • 7
1
vote
2 answers

Append to variable using class

I create UrlParamClass and i want to know, how i can append value. See this example: class UrlParam { append = (key, value) => { return `&${key}=${value}` } } let param = new…
Marty
  • 534
  • 8
  • 24
1
vote
0 answers

Unusual variable declaration in C++

// s isn't declared before std::string(s); s = "Hellow world"; It compiles and works as if s was declared as usual at least on msvc and gcc (C++14). Why is it so? Did not find explanation in standard. Does it contradicts the standard?
1
vote
2 answers

What is it called in .NET when a variable of a type is declared, but isn't actually instantiated?

such as: int i; or public delegate void MyAwesomeDelegate(int i); We have the word instantiate to mean we actually created an object. But what about when we have just declared variable of a type and it's just null?
richard
  • 12,263
  • 23
  • 95
  • 151
1
vote
1 answer

External static declaration - K&R2

I'm reading "The C Programming Language," Second Edition, by K&R and on page 83, section 4.6 "Static Variables" K&R state: The static declaration, applied to an external variable or function, limits the scope of that object to the rest of the…
1
vote
1 answer

Enumeration constant declaration vs. definition - C standard

The C11 standard specifies in section 6.7/5: C11 6.7/5 A definition of an identifier is a declaration for that identifier that: (...) — for an enumeration constant, is the (only) declaration of the identifier; (...) Does the wording of the…
1
vote
1 answer

C++ Problem declaring multiple object instances on the same line

For a homework assignment, I'm having a hard time understanding the behavior when the main class is instantiating two objects of the same class on the same line as follows. Note that the object of the assignment is for the class to behave like an…
ChrisM
  • 199
  • 2
  • 3
  • 8
1
vote
1 answer

c# Declaration unknown number of matrix in a loop

i need to declare 16x16 matrix blocks in a loop. Because i don't know how many blocks i must create. It changes acording to width. I have a code like this and name of the blocks must go like this: "block1, block2, block(i)" How can i declare this…
1
vote
5 answers

javascript function scope, variable declaration

lets say that I have the following scenario: var namespace = {}; (function($) { $.extend(namespace, { test1: function(someArray, someObj) { for(var i= 0, ii= someArray.length;i
Alex Pacurar
  • 5,801
  • 4
  • 26
  • 33
1
vote
1 answer

What is the difference between the parameter c[a][b] and c[][2]

Given the following two declarations, what is the difference? int foo ( int a, int b, int c[a][b] ) { int foo ( int a, int b, int c[][2] ) { I understand the top statement is a "Variable Length Array" (VLA), but I'm not sure I understand what that…
1
vote
3 answers

Python class declaration "positional argument" error

I'm experimenting with pandas. I'm trying to create a simple object that represents the data i want to work with. To do so I've written the code below to create an object but I'm getting: TypeError: test_df() missing 1 required positional argument:…
Matias Salimbene
  • 510
  • 6
  • 19
1
vote
1 answer

Maple Code Generation: How to declare variables automatically?

In Maple (version 14, if it matters), I define a procedure that uses a globally-defined expression in maple, but when I go to code generation, it assumes the variable is not what I am expecting. a:=x+y*x p := proc (x::float, y::float); return a; end…
Brandon Pelfrey
  • 2,449
  • 6
  • 22
  • 22
1
vote
2 answers

What does this CSS declaration mean?

could you tell me what does this declaration mean. Why does it have ul tag mentioned twice? .jqueryslidemenu ul ul
hanazair
  • 819
  • 1
  • 10
  • 22
1
vote
2 answers

Definition and declaration of variable with a value

Just started with K & R and on the 2nd chapter, there is the line: Declarations list the variables to be used and state what type they have and perhaps what their initial values are. So: int x = 42 is a definition. and int x is a declaration…
user225312
  • 126,773
  • 69
  • 172
  • 181
1 2 3
99
100