All Questions
169 questions
0
votes
1
answer
116
views
Pass array of unknown size to function [duplicate]
I want to pass an array which can have different sizes to a function. I am on an embedded system with limited capacities. I thought about the following ways of implementing it:
I don't want to use ...
-1
votes
1
answer
64
views
Question about returns statements and function parameters
I'm new to software and there is this piece of code which is a solution to an array exercise but I don't understand why it works. First of all the first thing it does is to return the string you enter ...
0
votes
1
answer
92
views
why is it that when I pass an array as a parameter for a function, its values are changing? [closed]
the function is supposed to receive: a sorted array of integers, a starting index, an end index, and an integer number, and return the amount of values in the array between the start and end indexes ...
-1
votes
1
answer
64
views
how to declare Powershell parameter
I have a Powershell function where I am trying to declare some parameter $vipstatus, I mean when I try to execute the function with that parameter I want to see only the result stored in $vipstatus.
...
1
vote
1
answer
47
views
Can the values vary depending on the position of the parameter in the function?
Why do the same functions have different results except for the parameter order of the functions?
Like, for example:
My Code
#include <stdio.h>
#define MAX_SIZE 100
void sum2(float *list, int n);...
0
votes
1
answer
94
views
Write a MAIN function and two FUNCTIONS to compute and print the elements of a two-dimensional 30X25 integer array A which are square numbers
When I set the cols=25 and I set the value of rows more than 25 , I run the program but ıt cant show the descending array and the array without duplicates. It just show the array you get from the ...
0
votes
2
answers
336
views
Create function with array as parameter and also array type of element
I'm looking to do a function which take all the information of one Element of my structured array. And as I would like to do it on many array (of same Type) and many elements of this array I'd like to ...
-1
votes
1
answer
47
views
Error when passing vectors as parameter in Xcode
I'm working on a program that I've seen other people do online except I'm trying to use functions to complete it to make it somewhat more challenging for me to help me better understand pointers and ...
0
votes
1
answer
222
views
C++ pass an array to a function without knowing its type
I want to make a function that takes an array as an argument with ANY type and returns its length like the following example:
unsigned int getLength(array)
{
return sizeof(array) / sizeof(array[0])
...
0
votes
0
answers
26
views
Javascript Call Array With Function Parameter
The parameter of the function comes with index page. I have a carname array and need to call carname array use the parameter of function. When i use parameter it will be string value and i can't call ...
0
votes
0
answers
33
views
How do I determine when to change the output format after I've found the last value I'm looking for? [duplicate]
I have a function that outputs the outliers of an array of numbers with these given parameters:
// countArray is an array of numbers
// numCounts is a global int = 15
// avgComputed is the computed ...
1
vote
1
answer
2k
views
How to use default values for array parameters in pine-script functions?
Pine-script;
Libraries cannot use global variables in exported functions, so I cannot use a global array as a default value.
Functions do not accept function results as default values.
Is there a ...
2
votes
1
answer
4k
views
bash how to shift through initial arguments passed to a function
I want to send multiple parameters to a function in bash. How can I accomplish this so the function parses though each parameter properly?
Would like to avoid having to use eval if possible.
Here is ...
0
votes
1
answer
118
views
Accepting an array with n elements in a function - Python
Is there a way in which I can set a function to accept an array with a certain number of elements as a parameter?
I am wondering whether this is possible in the parameter section itself and not ...
0
votes
0
answers
593
views
Javascript my function parameter is undefined when console.logging
I'm creating a function that searches for the current part of the array that you are at. I've already created something like this before, but somehow it says that my param is undefined when i try to ...