Questions tagged [initializing]

115 questions
0
votes
2 answers

Initializing Object Property

I've been following along Eloquent Javascript and have come across this piece of code: var protoRabbit = { speak: function(line) { console.log("The " + this.type + " rabbit says '" + line + "'"); } }; Coming from a…
user5056973
  • 387
  • 5
  • 16
0
votes
1 answer

Initializing a const pointer to a structure c++

I am a beginner in C++, and got confused about the initialization of const pointers declared in headers. To give but one example, I have in my header a structure and a class like: /* header file.h */ typedef struct A{ ... } A; class myClass{ …
user8085232
0
votes
1 answer

After properties set equivalent in Spring test class?

I have a class like @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes={MainConfig.class}) public class AbstractCSVFileProcessOpTest { @Autowired FileSource fileSource; @Autowired ReadFileOp readFileOp; can I…
Dims
  • 47,675
  • 117
  • 331
  • 600
0
votes
0 answers

Initializing an Array of Structures

I am Attempting to Initialize an array of structures, the user will be prompted to enter information, and I will then store it and display it though my structure array. I am having difficulties however initializing the contents of my array to…
eggo
  • 83
  • 1
  • 6
0
votes
2 answers

Structure initialization as argument

I try to send some struct into STL list; struct obj { int a; int b; } list < struct obj> mylist; struct obj a = { 0, 1}; mylist.push_back ( a); Is there any other way to initialize argument of push_back? For example: mylist.push_back (…
rewriter
  • 1
  • 1
  • 1
0
votes
1 answer

Initializing an object from subtype

I need to create and initialize an object from a subtype B, with supertype A in PL/SQL: create or replace TYPE "A" as object{ school_category varchar(10); } create or replace TYPE "B" UNDER A { school_name varchar(10); school_ranking…
Shahb
  • 47
  • 1
  • 6
0
votes
1 answer

C++ SDL, variable is being used without being initialized

When I try to compile this code, I get an error: The variable 'screen' is being used without being initialized. Can anyone tell me why? class Board { public: int board[BOARD_HEIGHT][BOARD_WIDTH]; void drawboard(SDL_Surface *screen) { …
Pietras9
  • 13
  • 5
0
votes
1 answer

How Initialize web2py with password in terminal

I need create a terminal alias for inicialize web2py, but I dont see how initialize the web2py with password parameter. I edit the "~/.bashrc" like this: alias w2p="python web2py -p 8000" And I need put the password here too. Exists some parameter…
0
votes
2 answers

declare and initialize variables in java

this code is for craps game (Deitel java how to program) why myPoint variable needs to be initialize and if not a compilation error will occur??? i mean if there is win or loss in first roll there is no need to initialize mypoint (because it is…
hamid_c
  • 849
  • 3
  • 11
  • 29
0
votes
1 answer

simple change-making program in C; Not understanding initializing

I've been working on a program for a couple of days in my beginner's C class. I've written, rewritten, broken down, and rewritten this code already, googling all of my questions with little help. I suspect what I'm doing wrong is very simple, but I…
Keapora
  • 3
  • 2
0
votes
1 answer

What happens when I am initializing my UIView in subclasses?

A.swift class A: UIView { override init() { super.init() println("init A") } override init(frame: CGRect) { super.init(frame: frame) println("initFrame A") } } B.swift class B: A { override…
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
0
votes
2 answers

Object reference not set to an instance of an object (noob)

I have this simple code, but I get the error "Object reference not set to an instance of an object" when I try to access the "MyCarslist" initialized in my constructor. What am I missing? class Cars { public List MyCarslist { get; set;…
humudu
  • 699
  • 1
  • 7
  • 13
0
votes
1 answer

Objective C initing and object with a multi-dimensional array

I have a set of legacy multi-dimenstional arrays of a struct SpaceData; the following is a typical one, and some are larger. SpaceData dataArray[2][4] ={ { {16, 0, false}, {6, -2, true}, {9, -1, true}, {9, 0, true} }, { {1, 0, false}, {8, -2,…
user3835673
  • 171
  • 1
  • 1
  • 6
0
votes
1 answer

How to initialize a number of variables within a for loop in Arduino

I'd like to initialize a bunch of variables by calling them in a for loop like this. The effect I'm hoping for is that I'd have three variables at the end aVar = 1, bVar =2, and cVar = 3. char* variables[] = { "aVar", "bVar", "cVar"}; int…
flomerboy
  • 1
  • 1
0
votes
2 answers

I'm trying to make a function that initializes a 2D array in C++

IDE gives me this error when I try to compile: random.h|11|error: expected ',' or '...' before 'arr'| amongst others but this is the one that is my biggest problem. I can do this in my main function but I want to do it by calling a function that…
The_0bserver
  • 11
  • 1
  • 2