Skip to main content
Filter by
Sorted by
Tagged with
4 votes
0 answers
44 views

Problem Description I've encountered an interesting behavior in Java regarding forward references in instance initializer blocks. When I try to access an instance variable directly, I get a forward ...
happy's user avatar
  • 515
-1 votes
3 answers
157 views

This is a C program that copies its input to its output, replacing each string of one or more blanks by a single blank. I don't know what is the best way to proceed when the program starts and there ...
ivangouba's user avatar
1 vote
2 answers
594 views

I'm getting the following error message: The variable '$dateTime' cannot be retrieved because it has not been set. The error is generated by the line [DateTime]$dateTime in this code: [string]$...
aksarben's user avatar
  • 666
0 votes
2 answers
109 views

There is something that I couldn't understand. I have the following code, which its purpose is to get the total of the two arrays. let r1; let r2; let total; function totalSum(arr_1, arr_2) { ...
Ameen Shamsan's user avatar
1 vote
1 answer
47 views

I am trying to develop an application where the user moves a can back and forth on the bottom of the screen to try to catch bees as they fall. I have successfullly gotten the can movement working, but ...
jajuub's user avatar
  • 13
0 votes
1 answer
443 views

I am not very well acquainted with python, but have by much trial and error, and building upon the work of others, developed a simple working and reliable interface between Tradingview (TV) and ...
Snorkel's user avatar
  • 11
1 vote
1 answer
204 views

I'm essentially making a small, simply "twenty questions" style program, using nested if-statements to try to guess what object the user is thinking based on clarifying questions. I'm using ...
dissidenttux's user avatar
0 votes
2 answers
973 views

I came across a code example learncpp.com where they zero-initialized a variable, then defined it with std::cin: #include <iostream> // for std::cout and std::cin int main() { std::cout &...
Caleb Chervenka's user avatar
-2 votes
1 answer
128 views

I have tried a backtracking algorithm and receive different results when I initialize a variable inside and outside a for loop, but I don't understand why. #include <stdio.h> int a[10]; int n; ...
Ngọc Khánh Hà's user avatar
0 votes
1 answer
70 views

I am trying to create 40 cells with react , each should have a different title. For example a0 ...a9, b0 ..b9 etc. This is my code const mapItems = () => { let playerId = ["a", "...
Vlad Halyts's user avatar
0 votes
1 answer
697 views

Stages of instance initialization are captured for example in this question. Nevertheless, it doesn't capture the moment when the instance variable get's declared and auto-initialized. From my test ...
Miroslav Makarov's user avatar
0 votes
1 answer
105 views

I have been practicing C++ in HackerRank. There I was seeing different submissions and something new came in my sight. someone used int i(0) in for loop like for (int i(0), mark; i<q; ++i) So my ...
setller's user avatar
  • 43
0 votes
2 answers
162 views

The following C code takes so long to compile and execute. #include <stdio.h> int main() { int max; printf("Enter a value for max: "); scanf("%d", &max); ...
Surya Narayanan's user avatar
3 votes
1 answer
134 views

The following code will return an error, $ perl -E'sub foo { my $bar if 0; $bar++ }' This use of my() in false conditional is no longer allowed at -e line 1. But this code $ perl -E'sub foo { my $bar ...
Evan Carroll's user avatar
0 votes
1 answer
72 views

How does this code work fine and prints 9? public class Dog{ static { age=9; } static int age=7; } And this code doesn't compile(illegal forward reference)? Notice I changed ...
Stefan Jankovic's user avatar
1 vote
1 answer
3k views

I am trying to run the main() function for a repository but am running into an intractable panic which occurs upon variable initialization: > go run main.go go: finding github.com/myorg/some-repo/...
Kurt Peek's user avatar
  • 58.5k
1 vote
1 answer
224 views

I know that uninitialized static variables are stored in BSS and therefore guaranteed to be initialized with all 0 (for their respective data-type size). Also, in C, static variables can be defined ...
StoneThrow's user avatar
  • 6,435
1 vote
0 answers
50 views

I saw many confusing answers about the following point : Next, execute either the class variable initializers and static initializers of the class, or the field initializers of the interface, in ...
Mohammad Karmi's user avatar
2 votes
1 answer
387 views

As far as I know the following statements are the same: A a1(1); A a2=1; Header: class A { public: A(int num){} }; But when using reference it won't compile class B{ private: int ...
Nizarazo's user avatar
  • 139
1 vote
3 answers
3k views

In C, is there a way to ensure a function is called only once without using pthread_once? The following works in C++ but apparently not in C because initialization of a static variable must be to a ...
StoneThrow's user avatar
  • 6,435
7 votes
3 answers
2k views

I asked a question about it and didn't get a really clear answer, but after reading this article I started preferring const char[] to const char*. I've come upon a difficulty when initializing with a ...
Jonathan Mee's user avatar
  • 39.1k
1 vote
1 answer
884 views

So let's say I'm working with this toy example: struct Foo { int member; }; I know that the default constructor won't default initialize member. So if I do this, member remains uninitialized: ...
Jonathan Mee's user avatar
  • 39.1k
1 vote
0 answers
708 views

I am trying to run this ResNet with a few alterations.https://github.com/tensorflow/models/tree/master/official/resnet After looking up the error, I understand the problem to be either : That the ...
Marian Velikov's user avatar
1 vote
1 answer
961 views

I'm writing a program in PowerShell that uses iText 7 DLLs. I use a DLL disassembly tool, IText DLLs, and iText sample/example C# code and convert the sample C# code to PowerShell code. For example: ...
VA systems engineer's user avatar
2 votes
1 answer
334 views

I'm using PHP 7.1.11 As mentioned in the PHP manual : Heredocs can not be used for initializing class properties. Since PHP 5.3, this limitation is valid only for heredocs containing variables. ...
PHPLover's user avatar
  • 13k