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
0
votes
1 answer

Read From File and Store Strings into a Multidimensional Array of Strings in C

I really need to know how to fix this. I have a file that is read and I store the strings from the file into an array that is passed as an argument, but I can't figure out how to make it work. When I do print the content of the array it says…
exceltior
  • 49
  • 1
  • 1
  • 5
0
votes
4 answers

javascript/backbone js passing parameters to functions - some doubts

This may be a javascript 101 or Backbone 100 questions. But I feel comfortable in asking this beginning question and not being made fun of here :) The following code snippet is from Code School's Anatomy of Backbone JS course: render: function(){ …
Bharat
  • 2,409
  • 6
  • 32
  • 57
0
votes
2 answers

Dealing with pointer argument in C

I'm using a library which has a function with the following signature: void LED_stop_blink_task ( void * callback_parameter ); The actual parameter the void pointer stands for is a pointer to uint32_t, which is the number of the led on the…
stdcall
  • 27,613
  • 18
  • 81
  • 125
0
votes
1 answer

Making function pointers in C to Java functions

I am re-writing a Palm Pilot program to Android, and have hit a wall. My lack of C experience leaves me completely at a loss for ideas. This is the original C code : The .h file : typedef void (__stdcall *fp_setbaud)(WORD); typedef short (__stdcall…
JuiCe
  • 4,132
  • 16
  • 68
  • 119
-1
votes
1 answer

C++ Compilation error: Undefined identifier (for a function parameter)

I have a C++ class main.cpp in which I created a class like following: class MapSearchNode { public: unsigned int x; // the (x,y) positions of the node unsigned int y; MapSearchNode() { x = y = 0; } MapSearchNode( unsigned int px, unsigned int…
Anila
  • 1,136
  • 2
  • 18
  • 42
-1
votes
2 answers

Passing values to a function from within a function in python

I need to pass values from one function to the next from within the function. For example (my IRC bot programmed to respond to commands in the channel): def check_perms(nick,chan,cmd): sql = "SELECT `"+ cmd +"` FROM permissions WHERE nick = '"+…
Jguy
  • 583
  • 1
  • 11
  • 33
-1
votes
3 answers

Javascript function parameter query

Do javaScript accept multiple strings as a function parameter? function name(Haydon Lyson){ //code } will it be accepted? If not then how can we pass multiple strings as function parameter.
Ivanovich
  • 19
  • 1
-1
votes
2 answers

Is it true that when passing an argument to a function, it is like assigning the value to the parameter?

I am new to C++ and I am writing pseudo code here: void fn(a) {} fn(b) It is correct to assume that in the function body fn what happens is this assignment `a = b` I know we can pass the reference/pointer instead of just the value. I get it. But…
Joji
  • 4,703
  • 7
  • 41
  • 86
-1
votes
1 answer

How can I define constructor when the class member parameters have the same name?

class MyStrValArray { private: vector p; public: MyStrValArray(const int n = 10, const int i = 1, const char ch = 'a') {} ~MyStrValArray(); void init(const int n); void clear(); unsigned capacity(); unsigned size(); …
Yerim Kang
  • 201
  • 1
  • 4
  • 11
-1
votes
2 answers

Passing a function with two parameters into a function that accepts a function with one parameter as input in C

I am coding in C. I would like to pass a function that accepts two parameters with one parameter set to a value into a function that accepts a function with one parameter as input. void fTwoParameters( float a, float b ){ } void outerFunction(…
user24205
  • 481
  • 5
  • 15
-1
votes
3 answers

Why is this loop using function parameter returning only once?

const alphabets= { first: ["a", "b", "c"], second: ["d", "e", "f"], third: ["g", "h"] }; function trial(arr) { for (let i = 0; i < arr.length; i++) { const argh = `
  • ${i}
  • `; return argh; …
  • NewLearner
    • 13
    • 1
    -1
    votes
    3 answers

    What does arr++ mean in a function "int f(int arr[])"?

    I was looking at this code and understood pretty much all of it except one thing: what does Arr1++ means? What does it do to the array? since Arr1 is not just a normal variable like int.. bool theSameElements(int Arr1[], int Arr2[], int size) { …
    Cocoboom
    • 35
    • 1
    • 7
    -1
    votes
    1 answer

    One Typescript Function Parameter - Optional Types?

    I guess I'm bad at looking through documentations, because I can't figure this out: var help = (param: string or number) => { return param; } How do I allow the help function to have a param of either a string or number? For…
    Blake Allen
    • 347
    • 1
    • 10
    -1
    votes
    1 answer

    Perl subroutines with exact signature / exact number of parameters

    I have seen usage of $ in subroutine definition somewhere. To learn more about it, I created various cases with a simple subroutine, and came to know that it's used for defining subroutines with exact signatures. Can anyone please confirm: Whether…
    Kamal Nayan
    • 1,890
    • 21
    • 34
    -1
    votes
    1 answer

    Change Value of Variable in Function in C

    The final values for x and y should be x = 4 and y = 21. I understand why y = 21, but why is x = 4? Should "a = 5" not change the value to 5? Thanks int f(int a, int *b){ a = 5; *b = *b + 3*a; } int main(){ int x, y; x = 4; y =…
    Joe
    • 17
    • 1
    • 3
    1 2 3
    20
    21