Most voted "argument" questions
An argument represents the value you pass to a procedure parameter when you call the procedure. Call code provides the arguments when calling the procedure.
Learn more…42 questions
Sort by count of
-
151
votes7
answers26094
viewsWhat is the difference between parameter and argument?
I have always used the terms "parameter" and "argument" as if they were synonyms: what is passed to a function and/or what the function receives as input. In the same way, I have read one and…
-
13
votes2
answers265
viewsWhen is a default argument evaluated in Python?
Let us consider the following class: class Foo: def __init__(self, values = []): self.values = values Note that we are using an instance attribute and not a class attribute, but see the following…
-
13
votes4
answers542
viewsIs there a design standard or recommendation that defines the optimal amount of parameters a function should have?
I always value writing my codes in a short and readable way. My motto is always to think that "someday someone will mess with my code and I want the person who does it to understand it easily".…
function encoding-style parameters language-independent argumentasked 6 years, 4 months ago Wallace Maxters 102,340 -
12
votes1
answer449
viewsWhat’s this 'in' in C#?
In the new version of C#, version 7.3 the parameter changer was introduced in, but I didn’t understand its functionality. By name, it seems that it is used as "input" for the values, contrary to the…
-
10
votes2
answers188
viewsBoolean arguments, in general, are not good?
I was reading a little bit of Clean Code. The book talks about "good programming practices", and on the Internet, in one of the slides it is said that: Boolean arguments, in general, are not good. I…
encoding-style language-independent boolean argumentasked 7 years, 3 months ago UzumakiArtanis 9,534 -
6
votes2
answers113
viewsIs it possible to access the same argument twice in sprintf?
In PHP times the function sprintf. With it we can format the values sequentially passed from the second parameter. For example: sprintf('Meu nome é %s e tenho %d anos de idade', 'Wallace', '26') The…
-
5
votes1
answer3608
viewsRun Python file with arguments
In my program, I do the following operation: import sys qtd_ponts = int(sys.argv[1]) I would like to know a practical way to run this file .py passing arguments without needing an IDE, using files…
-
5
votes2
answers7137
viewsWhat does KWARGS in Python mean?
I know that, in Python, we can define in a function something similar to what they call "named Parameters", ie, "named parameters". def my_func(**kwargs): pass my_func(nome="Stack Overflow",…
-
5
votes3
answers9397
viewsHow to pass arguments by reference in Python?
When I studied Pascal remember that my teacher explained that to pass an argument by reference it was necessary to put var in front of the variable, in the function/procedure parameters. Example:…
-
4
votes2
answers455
viewsHow to fix this error "Cannot Convert from 'int' to 'char[]'
Why is this error presented? I believe the logic is right.…
-
3
votes1
answer409
viewsHow to pass an array as parameters or arguments?
I have two functions: function example($param1, $param2) { echo $param1 . $param2; } function frutas($fruta1, $fruta2, $fruta3) { echo $fruta1 . $fruta2 . $fruta3; } And I also have a variable that…
-
3
votes2
answers1022
viewsError: incompatible type for argument 1 of 'printf'
I have this activity, exercise, where is to display the largest number, but is giving the error: "incompatible type for argument 1 of 'printf' " On the command line "printf (valor2);". Code:…
-
3
votes1
answer113
viewsHow to set a pointer as the default parameter in C++?
I am "programming in C", but compiling using the extension .cpp and the g++ to have some facilities. My goal is to make a program that receives a starting salary and calculates the final salary…
-
2
votes2
answers1773
viewsJava args pass file as parameter
I am doing a graph work where I have to make a library and after generating the jar in the execution I need to inform two parameters that are txt files, in the first will be the input data in the…
-
2
votes2
answers4863
viewsHow to create a method with optional parameters in pure Java?
How I create a method that does not need to enter all parameters? Ex. There is a method that asks for 5 parameters. But I intend to use only 2.
-
2
votes1
answer581
viewsHelp with the argparse library
I’m trying to use the library argparse to guide the main module (__main__) between two possible executions: import unittest import argparse arg = argparse.ArgumentParser(description='Execution…
-
2
votes1
answer153
viewsHow to pass the return of a function that is a tuple as arguments to another one in Python?
I’m trying to return multiple values from one function to another with multiple parameters: def chamar_ab(): a = 1 b = 2 return a, b #tupla def soma(x, y): return x + y But using it doesn’t seem…
-
2
votes2
answers106
viewsHow to put the response of a function as a parameter in another function?
const soma = function (a,b) {return a+b} console.log(soma(2,4)) let nun1 = 3 const soma2 = function (soma, nun1) {return soma+nun1} I want to get the result of the sum function which is 6 and somar…
-
1
votes2
answers1328
viewsCalling javascript function with null parameter
The function verificaCampoVazios has two parameters (fs and campos). verificaCamposVazios = function (fs, campos) { console.log(campos[0]); } Example of how it is called function:…
-
1
votes2
answers287
viewsHow to make a function use how many arguments are provided to it
Is there any way to make a function use multiple arguments without their declaration? For example: #import<stdio.h> #import"rlutil.h" //para as cores void a(color,string){ setColor(color);…
-
1
votes0
answers74
viewsAdd argument at command line callto protocol
I work by making calls using the Microsip program. However, I find it difficult to automate the dialing in just one click. I found an extension in the Chrome Store that allows this by converting the…
-
1
votes2
answers668
viewsAssign values to a variable
I have the following program: #include <stdio.h> int a,b; int main(int argc,char *argv[]){ int c; printf("%d",a+b); printf("%d",c); return 0; } How do I pass a value to the global or local…
-
1
votes1
answer92
viewsList as function input
In Python 3.7 items of a list can be arguments of a function? def media(x,y,z): lista = [7,8,9]
-
1
votes1
answer1993
viewshow to resolve Missing 2 required positional argument python
I’m new to Python and programming and I’m trying to create a calculator (interactive way I think kkkk) using the content I’m learning to create functions, but it’s giving this error on the last line…
-
1
votes2
answers130
viewsResult Undefined when calling function in calculator
This script for calculation but it returns undefined, where I’m going wrong? var num1 = parseInt(prompt("Digite um número: ")) var operacao = prompt("Digite a operação: ") var num2 =…
-
1
votes1
answer50
viewsHow to call a function by a parameter using argparse?
I was able to call functions just by creating subparsers but there are two parameters left that are part of the parser, do you have any correct way to pass a function in the argument statement?…
-
0
votes1
answer881
viewsCreating new users through Shell Script
I’m trying to create a shell script to add new users to the GNU/Linux system But without entering native commands like adduser or useradd in the script, it would be something in the nail. I have…
-
0
votes1
answer162
viewsRuntime error in C
Well, it’s compiling everything ok, however, when I print out the elements of the entire tab matrix[8][8], which is a member of the checksum structure, the compiler, in a way is assigning numbers to…
-
0
votes1
answer658
viewsHow to count repeated arguments in R
I have a spreadsheet, I have to do some operations in the data, so I exported to R and can select the important arguments, now I need to know how many repeated elements there are in a column: for…
-
0
votes2
answers180
viewsError while running program using "args"
I am trying to run a program passing some values as parameters on the command line but is returning the error below. C:\Users\joao.mello\Documents\C#> .\exercicio32.exe 5 1 0 4 9 32 4 Unhandled…
-
0
votes2
answers560
viewsHow to use argc and argv on a windows terminal?
I am creating a stack for valid expression check, but it should be used in this int main( int argc, char **argv ) for input. I compiled and did not make a mistake, but I cannot create an executable…
-
0
votes1
answer446
viewsPowershell (new-Object System.Net.Webclient). Downloadfile Strings as Arguments
I have the following code that I use to download the last chromedriver for a specific folder: (new-object…
-
0
votes1
answer355
viewsUncaught Argumentcounterror in construction
I’m trying to list the database data, only when I try to list it returns the error: Uncaught Argumentcounterror: Too few Arguments to Function processes::__Construct(), 0 passed in When I declare…
-
0
votes1
answer253
viewsAdd parameters dynamically in a Javascript function
You guys, it’s okay? I am trying to create a function (I will call to execute) that takes as parameter another function (I will call word), a list of objects and a list of attributes to be accessed…
-
0
votes1
answer31
viewsJS - Target object as function argument
I come from C# and I’m having a hard time understanding this concept of passing the target object as a function argument. In the examples below, the first works, as I do to assign the function…
-
0
votes1
answer42
viewsUse arguments in a function from another function
I have a text document with the following format: word_1 word_2 word_3 word_4 word_5 word_6 For each line of that text document: first: I want to save the words and add "_info" to each word; second:…
-
0
votes0
answers49
viewsHow to fix: nonconformant Arguments (Octave)
Every time I try to run my code I keep making this mistake: error: projetofinaltry: =: nonconformant arguments (op1 is 1x1, op2 is 1x46801) error: called from projetofinaltry at line 108 column 14…
argumentasked 3 years, 9 months ago Taynah Costa 1 -
0
votes0
answers24
viewshow to resolve this error? (The argument type 'double' can’t be Assigned to the Parameter type 'int')
if (result & 1 == 1) { result = ~result; } var result1 = (result >> 1) * 0.00001; lList.add(result1); } while (index < len); the project is in . Dart in flutter error: "The argument…
-
-1
votes2
answers291
viewsVariable name passed in function argument
Situation I’m willing to develop this function function ve($var, $dieAfter = false){ $nomeDaVar = ????; echo '<pre>'; echo '$'.$nomeDaVar." = "; var_export($var); echo '</pre>'; if…
-
-1
votes1
answer186
viewsHow to get the file name to be opened with my program by clicking on this file?
I created a music player in the Python language and I would like to know how to play a song with my program by clicking on the file. For example when I open a song now, it automatically plays on…
-
-2
votes1
answer122
viewsA function that takes the names of two files as arguments
Program containing a function that takes the names of two files as arguments. The first file contains student names and the second file contains student grades. In the first file, each line…
-
-2
votes1
answer41
viewsHow to create optional parameters in C++?
In Python it is possible to have optional parameters in a function. It would look something like this: def soma(n1, n2 = 5): return n1 + n2 print(soma(5, 7)) If a second parameter is not passed n2…