Questions tagged [parameter-passing]

parameter-passing is the process of assigning values to the parameters of a function

Association of actual and formal parameters upon function call. See Parameter Passing and its methods. The most widely used parameter passing methods are:

  • call-by-value
  • call-by-reference
  • call-by-value-result
  • call-by-name
  • call-by-need
  • macro expansion.
8028 questions
2
votes
1 answer

Passing multiple text files as arguments to a script using a pattern

First of all I'd like to state that this is a debug question for an exercise, but I can't get any help from the lecturer, and as much as I've read up on arguments I can't seem to figure it out, so here I am. So I have a python script that compares…
George
  • 143
  • 7
2
votes
1 answer

Passing additional parameters to pracma::integral2

I am using pracma::integral2 to integrate a function that sometimes requires additional parameters, but integral2 seems not to recognise the parameters I supply. Consider these two functions: fun1 <- function(x, y) exp(-x^2 - y^2) fun2 <-…
JeremyC
  • 445
  • 2
  • 14
2
votes
1 answer

Issue with XSL Processor's Add Parameter Function

I have some code that's worked fine for years, but has recently stopped after the update to Windows 10 v1709. The IXSLProcessor.addParameter function has stopped working when using the processor returned by XSLTemplate60.CreateProcessor(). Here's a…
2
votes
1 answer

User Input as Argument C++

I am new to coding and was wondering why my code is not acting the way I intended. I build the code as a training program to help me practice what i have learned. The code seems to work fine, as expected, when I comment out lines 19 - 23,the multi…
2
votes
1 answer

How should I transfer variables/ parameters securely between multiple domains in PHP?

I would like to securely transfer sensitive variables between multiple in PHP. Normally I would use url parameters or session cookies to transfer non-sensitive values. I'm not sure how secure I can make cookies and url params or if there is a better…
jnthnclrk
  • 469
  • 6
  • 29
2
votes
2 answers

Handling unused getopts argument

I have a script that starts with getopts and looks as follows: USAGE() { echo -e "Usage: bash $0 [-w ] [-o ] [-c ] [-t ] \n" 1>&2; exit 1; } if (($# == 0)) then USAGE fi while getopts ":w:o:c:t:h" opt do …
mf94
  • 439
  • 4
  • 19
2
votes
3 answers

Is there a way to pass specific parameter to function(without order) in js?

Let's say I have the following function: function fun(a,b) { if(a) { //condition can be different console.log(a); // some other code } if(b) { //condition can be different console.log(b); // some other…
2
votes
0 answers

Angular 6 - Pass complex JSON Object in an HTTP Get request

How can I do a HTTP get request and pass an JSON Object. When I used Angular Datatable - Server side the Angular way, they are using a post request: this.http.post( 'https://angular-datatables-demo-server.herokuapp.com/', …
suhailvs
  • 20,182
  • 14
  • 100
  • 98
2
votes
1 answer

How to pass variables to another php file?

I have a PHP file "login.php" That is being called in a html using a js but the elements doesnt pass the variables to another php file "ucheck_com.php" Where it will perform the validations etc. is there an alternative way to do this? sample.html:…
totalnoob
  • 33
  • 7
2
votes
1 answer

How do I pass column-specific arguments to lapply in data.table .SD?

I have seen examples of using .SDwith lapply in data.table with a simple function as below: DT[ , .(b,d,e) := lapply(.SD, tan), .SDcols = .(b,d,e)] But I'm unsure of how to use column-specific arguments in a multiple argument function. For instance…
jsilva99
  • 25
  • 2
2
votes
2 answers

Trying to pass an array of structures but I get a "cannot convert 'struct' to 'struct*' error

I keep getting this error when I try to pass this array of structures into the function AthleticContest(): cannot convert 'person' to 'person*' Can someone please tell me what I am doing wrong? Am I passing the wrong thing into the…
CuriousGuy
  • 47
  • 4
2
votes
2 answers

How can I define a class that can only be instantiated when no parameters are passed to the constructor?

How can I define a class that can only be instantiated without parameters, and forbids instantiation when any parameters are passed to the constructor? My goal is to enforce a certain set of classes that are supposed to be "simple" and be used as a…
Dennis
  • 7,907
  • 11
  • 65
  • 115
2
votes
1 answer

Initializing members of a struct using other members?

I am wondering whether one can create a structure and, using the members/variables initialized in the structure as parameters, build other members. For example, I would like to make a structure: struct myStruct { size_t length; std::string…
2
votes
1 answer

Pythonic way to pass dictionary as argument with specific keys

What am I trying to solve: I want to create an object that is based on a dictionary. The object should contain some additional methods that are out of the scope of this question. There dictionary passed must contain a known set of keys. What…
glamredhel
  • 336
  • 3
  • 12
2
votes
2 answers

How add context menu item to Windows Explorer for folders different than exe

I successfully added an item to the context menu of folders (that's the easy part) but my program is jar extension when I try to open it via context menu error appears: This program will not work on your computer or something like this, so I tried…
1 2 3
99
100