Category "initialization"

error: new initializer expression list treated as compound expression [-fpermissive]

I am trying to write a playlist method for songs in c++, however, I keep running into frequent errors. template <typename T> struct cir_list_node {

Riot.js how to mount a precompiled Tag

How can I mount a tag that has been pre compiled to a function with riot.js/cli to iife JS version. What am I doing wrong? By getting an empty html DOM as a res

How to re-init the AlpineJS component after Livewire re-renders?

I have an alert component that I hide using AlpineJS but I want it to be visible again after Livewire re-renders. Showing the alert using Livewire component @if

How to initialize a struct to 0 in C++

Here is a related C answer that doesn't work (as a zero initializer for a struct) in C++: Initializing a struct to 0. One of the solutions presented is this: my

A problem was caused by an array that was not initialized

I am trying to solve a execise, which amis to find the Last Digit of a Large Fibonacci Number, and I try to search for others' solution, and I find one here: h

After upgrading to Ruby 3, unable to pass multiple arguments to my "initialize" method

I recently upgraded to Rails 6 with Ruby 3. I have this in a controller my_object = MyObject.new(my_object_params, @header) The object “initialize&rdquo

How does object initialization ambiguity get resolved?

The class has two constructors, one that has no initialization value and does not increase the 'val', the other takes a reference to an object, and increases 'v

Sum of numbers occurring in the multiplication table of 8. What's wrong with my code? Desirable output is 440, and I'm getting 33204

Sum of numbers occurring in the multiplication table of 8. What's wrong with my code? Desirable output is 440, and I'm getting 33204. #include <stdio.h>

Should I initialise an Angular service in its constructor or in the ngOnInit method of the app.component?

I'm new to Angular. I have a service that needs to subscribe to a subject provided by another service. If this was a component, I would create the subscription

C++: array<> too many initializers

The following code is returning the compilation error below. I'm stuck understanding how there are too many initializers. This code works using vector<X>

Check if dynamic array is initialized or contains value - VBA Excel

Is there a way to tell if some dynamic array, for example arr() as String is initialized? IsEmpty and IsNothing seems not to work with dynamic arrays. Currently

Is field initialization by another field permitted?

I'm trying to do this in my class: class Foo { _errorHappened = new Subject(); errorHappened = this._errorHappened.asObservable(); } I'm using a field'

malloc(): memory corruption (fast)

I just started to learn data structure and getting an error when executing malloc(): memory corruption (fast) what can be the issue and how to resolve it? I h

non-trivial designated initializers not supported

I have a structure as follows: struct app_data { int port; int ib_port; unsigned size; int tx_depth; int sockfd; char *servername;

ruby: calling super without having a parent class

I have a class which overrides self.new and calls super in it, but the class doesn't derive from antoher class. So what exactly does the call? class Test att

How to initialize only few elements of an array with some values?

Is it possible to assign some values to an array instead of all? To clarify what I want: If I need an array like {1,0,0,0,2,0,0,0,3,0,0,0} I can create it like:

Initialize field before super constructor runs?

In Java, is there any way to initialize a field before the super constructor runs? Even the ugliest hacks I can come up with are rejected by the compiler: cla

Firebase Android - Skipping initialization

I am currently implementing an Android app, which uses Firebase Cloud Messaging. I've implemented everything according to the tutorial on the Firebase page. Ho

How do I initialize a two-dimensional List statically?

How can I initialize a multidimensional List statically? This works: List<List<Integer>> list = new ArrayList<List<Integer>>(); But