Most voted "function" questions
The function (also called procedure, method, subprogram, or routine) is a portion of code intended to perform a single, specific task.
Learn more…1,309 questions
Sort by count of
-
0
votes2
answers112
viewsHelp fread C library function
Could someone tell me why this snippet of code just starts reading from the second element of the file? And how could I read all the records in the file? Code I’m trying to use to read a txt file…
-
0
votes1
answer30
viewsIs there any way to use self Execute functions in vb6?
In javascript we can write this in several ways: (function () { console.log("Olá"); })(); (function () { console.log("Olá"); }()); ! function () { console.log("Olá"); }(); void function () {…
-
0
votes2
answers354
viewsTwo strings starting from one, in C
Hello, I need a software that reads a full name, composed of a simple name and a surname, separated by "_" and prints them separately. The code should use the following main function: #include…
-
0
votes1
answer74
viewsError in running Function SQL Server
I have a database proof today and I’m practicing functions with old exercises only I’m getting an error when I run the function. tables set language brazilian; CREATE TABLE pedido ( nr_pedido…
-
0
votes2
answers3176
viewsCalling php function through a form
Good afternoon, I am trying to create a page on my site is wordpress in which the user chooses a file and this file updates a table in the database. I got code down, but when I click to load data,…
-
0
votes2
answers610
viewsArray by function in C
Good morning! I’m having trouble passing a vector to void function for the sorting to be done and returned, as well, problem to pass to another void function whose purpose is to display the already…
-
0
votes0
answers96
viewsHow to stop and restart a Jquery function that can be triggered by several elements?
Hello, I made a screen with a virtual keyboard, for a touch screen application. The client wants two inputs on the same screen and when the user selects an input, the keyboard must enter the values…
-
0
votes1
answer41
viewsI created a function to receive a structure, but it always returns 0, can anyone help me?
Structure: typedef struct entrada{ int M; long int Nmax; double a0, a1, a2, a3, a4, a5; double A, B, e1, e2; }valor; Function: double FuncaoDada(struct entrada valor, double x) { double resultado;…
-
0
votes1
answer14
viewsHow to register an external style in the functions of wordpress?
I’m having a hard time registering this style library: https://fonts.googleapis.com/css?family=Rajdhani functions of wordpress. Can help me?
-
0
votes1
answer697
viewsPassing matrix to function by reference
Good morning everyone, I wish in my code to leave the Main(); only with calling functions, all work is divided into small functions in the document. I want to write a matrix[3][3] in a function and…
-
0
votes1
answer89
views -
0
votes3
answers4086
viewsWarning: control Reaches end of non-void Function - c++
I’m doing a function to return the maximum and I’m having problems... #include <iostream> #include <cstdio> using namespace std; int max_of_four(int a, int b, int c, int d){ if(a >…
-
0
votes1
answer302
viewsCall a function based on the struct passed in the reference?
How Do I call the menu function by passing more than one struct per reference according to the validation in the validation function ? sorry I’m starting now and decided to do this little exercise…
-
0
votes1
answer1682
viewsCheck if a letter exists in the c++ string
I’m having problems in my function that checks the existence of a specific letter in a string (I don’t know much about pointers I only used because my other function wasn’t returning the string if…
-
0
votes1
answer59
viewsI’m having trouble printing a variable in my program
I’m doing a program that simulates a bank, in function criarpessoafisica I’m trying to get the algorithm to check that Cpf is already registered, but it’s not working ! For some reason he printed…
-
0
votes2
answers1259
viewsUnexpected token - React
I am trying to run a project, however it is displaying an error in the console related to a function I have, the error is as follows: "63:25 error Parsing error: Unexpected token, expected (…
-
0
votes1
answer147
viewsScript for Reading Webservice
I’m trying to make this code work, but in the excerpt: success: function(retorno) { If(retorno[0].erro){ $("h2").html(retorno[0].erro); } There’s been an error, and I can’t identify what’s missing.…
-
0
votes0
answers180
viewsInstall Apcu in PHP 7.3.5
I am working on a project to configure and install a GLPI server of calls in the company I work and I have to try to configure as many of these extenders, plus I’ve researched on all place this holy…
-
0
votes2
answers88
viewsHow to use extensive functions in Javascript
In Javascript primitive types have native functions, such as an object of the type Number has a function toString(): (1).toString(); // "1" And an array has a includes(): [1, 3, 4].includes(1); //…
javascript function functional-programming extension-methodasked 6 years, 9 months ago Yago Azedias 1,117 -
0
votes1
answer92
viewsAccessing a function variable
In C, I can use a variable outside the scope where it was declared? I know that the best thing to do is to declare her out of any role, because then she will become global. But I want to know how to…
-
0
votes2
answers46
viewsSE - Excel function
Good afternoon! I’m having trouble making a field true or false but with 3 variables. If A1 and B1 = "N" will be Null If only A1 = "N" will be True If Only B1 = "N" will be False How can I mount a…
-
0
votes0
answers282
viewsgetDay() Ionic method in and out of the constructor, error! - Typescript
Good afternoon guys, this is my first post here on stackoverflow so I already apologize if there are any mistakes.. My question is the following: I am working with Ionic and I need to "take" the day…
-
0
votes3
answers2912
viewsCreate Trigger with update setando field through a function
I’m looking to use a trigger to update the field of a table whenever there is an Insert in this same table. The problem I’m having at Trigger is that the update doesn’t work, it follows Trigger:…
-
0
votes1
answer297
viewsString check inside a C function
Greetings! I’m creating a C program where the user can change the state of some sensor by typing the sensor name and 1 or 0 to change the state of the sensor, being 1 for on and 0 for off. However,…
-
0
votes1
answer85
viewsHow to return a number as if it were a date?
Receive the date in the dd/mm/yyyy text format and return the date in the yyyymmdd number format (example: take "05/10/1983" and return 19831005). But it presented an error in the syntax. def…
-
0
votes1
answer54
viewsHow to set only a default parameter for a function?
I came across a problem in javascript that in python would be simple to solve, just saying that the parameter refers to 'text'. create_element (text = A média dos valores cadastrados é…
-
0
votes2
answers324
viewsHow to access parameters received from a class in an external javascript function?
How can I access parameters received from a class outside its scope, as in the function below. Or is there another better way to do this? helper.js class Helper { constructor(user) { this.user =…
-
0
votes2
answers4216
viewsFunction MAX only 1 (one) record on Oracle
Could someone give me a hand in using Oracle’s Function MAX()??? I need to do a query that returns only the last record of a history table, but I need to return 3 (three) columns of this record…
-
0
votes1
answer111
viewsHelp Solving Two Javascript Issues
Hello, I’m not able to solve these two issues, could help me. function dobroDoNumero (){ var dobroA = 4+4; var dobroB = 7+7; var dobroC = 8+-8; var resultado = dobroA+ ', ' +dobroB+ ', ' +dobroC…
-
0
votes1
answer93
viewsHow to pass the registration code as a function parameter?
I have to sort down the salaries of employees of a company. Entree: Tuition, salary, if you wish to continue Exit: Wages in descending order. The error that is appearing is the following: [Warning]…
-
0
votes2
answers1230
viewsHow do I return only the highest value within an array?
It does not correctly check the largest. For each animal it shows the weight of the animal as being the largest. #include <stdio.h> #include <stdlib.h> #include <string.h> #include…
-
0
votes5
answers158
viewsPython - Function that copies content from one list to another list
I need a function (copie_list, transcribed below) that takes two lists, dest and orig, and copies the content of orig to dest, see example below: >>> a = [8, 9] >>> b = [1, 2, 3,…
-
0
votes1
answer68
viewsAccessing the allocation causes program to stop working
I’m having a problem accessing a subscriber struct typedef struct Inscrito { char nome[50]; float cadastro; float nota; }; Inscrito *inscritos = NULL; it is as a global variable and every time I…
-
0
votes2
answers119
viewsonBlur (Javascript) inside a Loop For PHP
I have the following Java code: <script type='text/javascript'> function Calc(){ var qnt = document.getElementById('qnt_saida').value; var vlr = document.getElementById('vl_unt_org').value;…
-
0
votes1
answer85
viewsBecause in this case I had to use freopen?
I have the following code: #include <stdio.h> int main(void){ FILE *ptr_file; ptr_file=fopen("archive.txt", "r"); short size=0; char c; while(!feof(ptr_file)){ c=getc(ptr_file); if(c=='\n'){…
-
0
votes1
answer20
viewsExecute variable contained function name (PHP)
I am mounting an application that executes a function with its own name In case the Contact page would have to perform the Contactoctl() function only it is in a $method variable. How would I…
-
0
votes1
answer678
viewsTake data from a.txt file and store it in a list
What a function would look like to take this . txt and import in the lists? This function takes the data from the lists and stores the data in txt. def guardaTxt(lstModelo, lstCor, lstNumeracao,…
-
0
votes1
answer71
viewsWhy does the function leValidaText return trash?
I’m trying to validate the license plate of the car, but I’m not getting it. I tried to use the scanf instead of fgets and nothing. I have no idea what might be causing the problem. #include…
-
0
votes1
answer181
viewsPython strip() function malfunction
I have a list in a file, where each line has a user agent (with " at the beginning and end of each line), which is used in a later part of a program, to perform automated tests using Selenium. When…
-
0
votes2
answers60
viewsWhat does it mean when the console returns the function itself?
Edited. The console is returning the function itself as a response, not the function result. The goal is for the function to say whether or not one value is greater than the other. let…
-
0
votes1
answer119
viewsChange string using function parameter
#include <stdio.h> #include <stdlib.h> #include <string.h> void menu_principal(char* monstro1, char* monstro2){ int escolha; char monstro[20]; printf("King of Tokyo\n\n");…
-
0
votes1
answer218
viewsWhy do we use "void" typing in Angular?
Why in Angular we use typing : void? Example: ngAfterViewInit(): void {}
-
0
votes1
answer91
viewsI’m new to programming, how do I get out of sequential foma returns?
ano = input() a= ano.split() def contaDigitos(): for x in a: s= len(x) if s !=4: return "Ano invalido" else: return x def ehBissexto(): for x in a: x= int(x) if x % 4==0 and x %100!=0: if x>…
-
0
votes2
answers526
viewsApply a function to each element of a python matrix
I need to apply a lambda function to all elements of a matrix in and it returns a matrix of the same size type like this: i have the matrix mat in numpy style: mat = array[[1, 2, 3], [4, 5, 6]] and…
-
0
votes1
answer671
viewsSort matrix of n rows using the column value in C as a criterion
I have the following code : int** ordena(int **v, int tam) { int i, j,aux; int swap[3]; for (i = 0; i > (tam-1); i++){ aux = i; for (j = (i+1); j > tam; j++) { if(v[j][1] > v[aux][1]) { aux…
-
0
votes1
answer55
views -
0
votes1
answer73
viewsHow to plot a graph using a Function curve
I need to resolve a matter of an R course. But I don’t know if I did it correctly. Could you please help me? The question is this:: Question 2. Create a vector with the Cosine of Numbers between -10…
-
0
votes0
answers39
viewsFunction in Oracle Sql
How do I perform these if Else in SQL create or replace function inss(x real) return number is begin if x <= 840.55 then return ((7.65/100) * x); else if (x >= 840.56) and (x <= 1050.00)…
-
0
votes0
answers33
viewsIs it possible to see the declaration of an internal js function? eg: setInteval()
I was studying a little bit about functions and I wonder if it is possible to search the declaration of an internal function in javascript as well as I can do in internal objects.
-
0
votes1
answer739
viewsUpdate a value within a function
I am starting in Python and need help to create the following function: ESQUERDA = -1 DIREITA = 1 CANHAO = 'A' EXPLOSAO = '*' def moveCanhao(direcao, matriz): ''' int, (matriz) -> bool Recebe um…