All Questions
7,480 questions
0
votes
1
answer
55
views
understanding a part of recursion for a binary search tree
Hello I basically need to implement a recursive function for insertion of a binary tree. I already implemented the chunk of insertion function (wether it's largest or smaller than root) but there's an ...
0
votes
2
answers
64
views
C++ - Candidate function not viable: no known conversion from 'double[10][Globals::MAX_COL]' to 'double (*)[Globals::MAX_COL]'
When compiling my program, I get the following error:
No matching function for call to 'fillWithRandomNum'
Candidate function not viable: no known conversion from 'double[10][Globals::MAX_COL]' to '...
0
votes
1
answer
39
views
InsertAdjacentHTML is not a function [duplicate]
Going through the Javascript for Web Warriors book, Chapter 3 Project 5. It's an assignment to debug the code so that it displays cell phone sales in a barchart. The error: "Uncaught TypeError ...
1
vote
1
answer
78
views
Function is not working, but gives no error
I'm new to C#. I'm trying to make game in Unity. These functions are necessary for changing in-game tabs with help of a button.
public string check;
public CanvasGroup hydrogenScreen;
public ...
0
votes
1
answer
66
views
error CS0847: An array initializer of length '120' is expected
I am trying to compare elements of array to variables, but I always get this error and I don't know what to do to fix it.
using System;
using System.Linq;
public string[] groups = new string[120] { &...
0
votes
1
answer
95
views
How to pass array into parameters of function
I try to create alias in H2 for function with two parameters of array.
parameters: Array sourceArray,
Array subArray
Returns boolean:
TRUE if sourceArray contains all elements of subArray.
OR ELSE ...
1
vote
1
answer
63
views
The error is: passing argument 5 of 'init_node' from incompatible pointer type [-Wincompatible-pointer-types]
char initial_req_item[MAX_ANSWER_COUNT][10] = {" ", "свиня", "меч"};
int initial_req_val[MAX_ANSWER_COUNT] = {0, 1, 1};
int is_initial_req[MAX_ANSWER_COUNT] = {0, ...
0
votes
2
answers
29
views
Binary search 704 leetcode calling a function in python 3
class Solution:
def search(self, nums: List[int], target: int) -> int:
#establish a left and right limit
l = 0
#this will take from the right and push more ...
2
votes
2
answers
61
views
How do I use dynamically allocated array in different functions?
#include <stdio.h>
#include <stdlib.h>
int readingfromFile(const char *file_name) {
FILE *file = fopen(file_name, "r");
if (file == NULL) {
return -5;
}
...
0
votes
1
answer
73
views
Calling functions on array make the program to exit
I want a Game of Life program in the console.
The parameters to initialize the 'field' can be changed in the mainMenu(). When all is done, it returns 1, and the drawing begins.
When we return from ...
-2
votes
4
answers
91
views
Sequence Addition
Mr. Ric feels that alternating the schedule for paying for gasoline only disadvantages him. So Mr. Dip proposed a waytodivide the paymentschedule. For every 2n, they will change the pattern by ...
-4
votes
1
answer
88
views
Identical equation outputs a negative when it's supposed to be positive [closed]
I created 2 different programs for my intro to C++ class. One program has only one function and the other program has multiple functions that are getting called into the main function. I used the ...
1
vote
1
answer
89
views
Is there a way to send an 2d array into a function without knowing its size before runtime?
I keep getting this error:
use of parameter outside function body before ']'
I googled it and found that you apparently can't do this. Is there another way of doing the same thing I tried here?
#...
-3
votes
2
answers
89
views
Can you assign an element's class list to a variable by clicking on the element?
The main question I have is: Is there a way to assign to a variable an element's class list by clicking on said element without directly referencing the element in the JavaScript.
Expanding on this, I'...
1
vote
1
answer
75
views
File pointer declaration interferes with a local variable in an unrelated function
So for an assignment I have to write a program that more or less plays scrabble, the basic structure is a function reads an input word, and counts how many times each letter appears in it into an ...