Questions tagged [arguments]

An argument is a value passed to a function, procedure, or command line program. This also refers to the Array-like `arguments` object in JavaScript.

An argument is a value passed to a function, procedure, or program. It is often used interchangeably with the word "parameter", which also has more specific definitions. Usually "argument", or "actual parameter" (as opposed to "formal parameter") is the value of the parameter used within the called routine.

In other words, parameters are used in procedure definitions, and arguments are used in procedure calls.

arguments can also refer to the Array-like object in JavaScript that is available inside functions, this object can be used to access all of the function's arguments regardless of the function's signature.

11091 questions
3
votes
1 answer

How to get command line arguments inside LD_PRELOAD library

I would like to get argv from an LD_PRELOAD library, for instance, let us assume we call LD_PRELOAD=/path/to/my/fopen ./program input Inside my custom fopen I would like to get "input", hence the argv[1] of my program (also the argv[2] and so…
Maray97
  • 140
  • 1
  • 11
3
votes
2 answers

Passing an argument to a function that gets automatically converted to a pointer

Note: I am using the g++ compiler (which is I hear is pretty good and supposed to be pretty close to the standard). So, I think I've learned that passing a pointer-to-an-array or passing the actual array as an argument to another function always…
Jimmy
  • 4,419
  • 6
  • 21
  • 30
3
votes
1 answer

Why can't I access arguments.callee in this sloppy-mode function?

I am trying to access the arguments.callee property in the simple function below, but I couldn't since the function throws an error. function foo(a = 50, b) { console.log(arguments.callee); } foo(10, 50); Why is this happening? It seems that…
coderboy
  • 1,710
  • 1
  • 6
  • 16
3
votes
3 answers

I want a function to be able to take as an argument both a list of strings or several strings as *args

I have a function that should be able to take either many string arguments as *args, or a list of strings as an argument. For example: def getStuff(*stuff): for thing in stuff: print(thing) getStuff("cat", "mouse", "dog") getStuff(animals) I…
dm0413
  • 43
  • 4
3
votes
1 answer

Python argparse with numbered argument name

GNU grep has an argument to print a certain number of extra lines around a matching line. From the man page: -C NUM, -NUM, --context=NUM Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups…
csm10495
  • 569
  • 6
  • 12
3
votes
0 answers

What is the proper way to use module constants as default arguments in Python?

In essence, I have been able to solve my issue, but I still don't feel entirely comfortable with my solution and would like to ask what the community thinks. I found a similar issue on stackoverflow as well, but it does not help me with my…
JKarouta
  • 66
  • 5
3
votes
0 answers

Pass argument to VSCode command in tasks.json?

I'm trying to automate some stuff for a project, for example search for dates in the files in the project directory, and then copy any found dates into a separate file. Seems like tasks maybe could do this? But I'm having trouble, unsurprisingly. I…
3
votes
1 answer

Passing a class as argument which has a private constructor that takes no parameters

Simulator is supposed to carry a copy of Missile object inside it. But Missile has no public constructor with zero parameters, so I'm not able to pass it as parameter. I'm using Visual Studio 2010, and it gives the following errors: Error 1…
hkBattousai
  • 10,583
  • 18
  • 76
  • 124
3
votes
7 answers

wrong argument conversion preferred when calling function

I'm writing a program under MS Visual C++ 6.0 (yes, I know it's ancient, no there's nothing I can do to upgrade). I'm seeing some behavior that I think is really weird. I have a class with two constructors defined like this: class…
rmeador
  • 25,504
  • 18
  • 62
  • 103
3
votes
1 answer

How to execute SP with arguments 'table of foo'?

Using sqlplus how can I execute a stored procedure which has arguments which are 'table of foo' ? So for instance in the following package how can I execute 'Get_AnnotationsForEmp' ? create or replace PACKAGE "PKG_DROM" as TYPE…
glaucon
  • 8,112
  • 9
  • 41
  • 63
3
votes
3 answers

How can I pass multiple values for a single parameter into the API url in Django Rest Framework?

I have made a filter api like this. localhost/api/allpackages?price_min=700&price_max=900&destination=Spain&new_activity=Swimming&tour_type=Group%20Tour&featured=true&fix_departure=true But according to new changes, I should be able to filter like…
Reactoo
  • 916
  • 2
  • 12
  • 40
3
votes
1 answer

How to code optional arguments for a custom function that wraps ggplot()?

I have a general question that I couldn't find a satisfactory answer for. I'm building a set of visualization functions, and I want to let the user have flexibility when using them. For example, I'd like to keep it optional whether errorbars should…
Emman
  • 3,695
  • 2
  • 20
  • 44
3
votes
1 answer

How do pass variable pass by reference in C?

I want to display x,y,z value with pass by reference method how to do that? What is the pass by value-result? void f1(int x, int y, int z){ x = y + z; y = z + 1; printf("x: %d y: %d z: %d",x,y,z); } int main(int argc, char…
Serhat
  • 187
  • 1
  • 14
3
votes
1 answer

how to pass an array as argument in java (one line only)?

In ruby it would look like myfunction (["element1", "element2", "element3"],"other argument") Can I do the same in java? One line only. I know I can use String[] dataToPass = new String[3]; dataToPass[0] = "element1"; …
Radek
  • 13,813
  • 52
  • 161
  • 255
3
votes
4 answers

Class Constructor arguments C++

I am creating a pair1 class for a x and y Cartesian coordinate system. x and y are doubles. I need to have 3 constructors. No arguments, defaults x and y to zero. One arguement assigns x and defaults y to zero. One arugeument defaults x to zero and…
Stephen Rogers
  • 65
  • 1
  • 3
  • 5
1 2 3
99
100