Questions tagged [function-parameter]

The function parameters are the variable names, listed in the definition of the function.

In many programming languages, parameters are the essence of the functions. The function parameters define the variable names, listed in the definition of the function. They are often confused with (and referred to as) function arguments, which actually are the real values that are passed to and received by the function when it is being called.

314 questions
-1
votes
3 answers

Default Parameter Value for Function Type as Parameter Type in Swift 3

I want to pass a function to call inside the completion block if I need to, but I do not know how to set a default parameter for a function. func showAlert(controllerTitle: String, message: String, actionTitle: String, preferredStyle:…
-1
votes
1 answer

How to pass a class as a type in a function

I'm not entirely sure on the wording of my situation which makes it difficult to find the answer. Basically if there is a class A that has a private member which is of another class B (has-a relationship), how do I go about making Class A's…
-1
votes
2 answers

How could i write a function in Objective - C which gets 3 parameters and in the first parameter is stored the sum of the 2nd and 3rd parameter?

I am new to Objective C programming and i would like to know the steps/approach of resolving this exercise.
Max
  • 21
  • 5
-1
votes
1 answer

How to Take Lists of Any Types as Function Parameters Haskell

Hello I want to take lists of any type e.g. [Int], [Char], etc as parameters to a function. Basically all I want to do is something along the lines of: xyz :: [a] -> [a] -> (Int, Int) Were [a] could be a list of any type.
user2680579
  • 11
  • 1
  • 2
-1
votes
1 answer

Getting data in between two strings in Python2.7

I am trying to get the data in between two strings from a text file containing data like : X_0_Gui_Homescreen_FPS_List commands 1 :SensorFps ( 30.000) X_0_Gui_Homescreen_Homescreen X_0_Gui_Homescreen_EI_Switchview X_0_Gui_Homescreen_EI_Set commands…
user89
  • 129
  • 1
  • 3
  • 11
-1
votes
1 answer

Confusion about variables equaling functions JavaScript

I have these functions: function change(num1, num2){ //return number } function getFunction(funct){ //return function } this declaration: var funct = getFunction(change); and this call funct(array); I am confused about what the call…
-1
votes
1 answer

Declaring multiple variables at once in a function

If int a, b, c; is a valid declaration Why not int f(int a, b, c)?
David Ranieri
  • 39,972
  • 7
  • 52
  • 94
-2
votes
2 answers

Getting Previous declaration is here Error in C

Task: write a function to calculate the area of a square, rectangle, circle. My code is right. IDK why I am getting this error complete error #include #include int square(); float airclearea(); int rectangle(); int main(){ int…
-2
votes
1 answer

c function not printing when called and jump to the next function

I am trying to make a game called Tic-Tac-Toe-Tomek(variation of Tic-Tac-Toe).For now, i am making the win checking system. I us the inputs 'X','O','T' and '.' for space I use printf to see how the functions work. later i will remove them. the…
badboys
  • 9
  • 2
-2
votes
1 answer

PHP Validation Input Form

I'm making an input form, and I'm currently in the process of validating the code. I run into this validation code from a blog and it seems pretty neat. Does anybody know how to implement this code into a form? Any help is appreciated. function…
Mijail
  • 109
  • 1
  • 12
-3
votes
2 answers

Default Parameters in Functions - C++

If I'm not wrong this kind of declaration may be used to assign default values in a constructor: /* .h */ class FooClass(){ private: int* data; int depth, rows, columns; char* desc; public: ... } /* .cpp…
Matteo
  • 7,924
  • 24
  • 84
  • 129
-3
votes
2 answers

Javascript function(parameter), assign parameter to var

i am failing and i don't understand why, i hope some body could help me out.
what i want to do is when you hover over anvil it starts a function function show(x){ x.style.backgroundImage =…
Samuel
  • 11
  • 4
-3
votes
1 answer

How to create a void function to output highest paid customer to an output file?

Everything else in my program is running correctly i just need help to set up a void function to calculate the highest paid customer. /* Hector Gutierrez Date: November 27,2013 Math 1900 This program reads information from a file and…
His_Panic
  • 3
  • 4
-5
votes
1 answer

I don't know how to make this function

Original question I am writing a function called Evaluate in C++. It accepts three arrays as parameters: double Evaluate (double inputs[], double hidden[], double outputs[]) { // To-Do... } The problem appears in this scenario: The programmer…
Ed The ''Pro''
  • 875
  • 10
  • 22
1 2 3
20
21