Questions tagged [function-call]

A function call is a line of code that executes a specific block of code defined as a function, that is, self-contained code that may optionally take arguments, defined for the purpose of code reuse.

A function call is a line of code that executes a specific block of code defined as a function, that is, self-contained code that may optionally take arguments, defined for the purpose of code reuse.

760 questions
-2
votes
4 answers

Passing 2D array by value doesn't work

I am trying to pass a 2d array to a function. I don't want the actual array to be modified. So pass it by value. But my actual 2darray is getting modified.(when i modify myArray, x is getting modified). Why is it so? int main(int argc, const char*…
-2
votes
3 answers

Functions in different files not working properly

I made a program that calls this function. I know this because "Int Strength has been called" appears in the output box. However, it will not change the values that I tell it to do. I want it to get integer values from main(), then use them and…
Lemonizer
  • 83
  • 2
  • 4
  • 14
-3
votes
2 answers

Calling functions while using multiple .cpp files

I would like to ask a question about the output when I called an inline function, that was declared inside MyHeader.h, which was defined in both source_1.cpp and source_2.cpp files, using the int main() function inside source_2.cppfile. When I do…
-3
votes
3 answers

Calling a function in from main()

I've just started to learn C, and right now I find it a bit confusing how to call one function from another. Here's my little project, I thought that writhing the line "int result = timeToWork;" would be enough to call that function, but the warning…
-3
votes
1 answer

Can someone tell me why I am unable to find the length of array using sizeof() function here?

When I changed the code to include an argument for size, the code worked correctly. But I cannot understand the error it is showing when I'm calculating length of array using sizeof() ? #include using namespace std; void display(int…
utkarshd3
  • 11
  • 1
-3
votes
1 answer

Issue when calling function from other Python file

I'd like help to resolve an issue I run into when I import and try to use a function that is stored in another python file. I am pretty sure it's a basic mistake I am making, and in the other Stackoverflow posts I haven't found anything similar. The…
-3
votes
1 answer

How do you call a function that takes in a MAT file, manipulate the data in that file, and create a new textfile with that same MAT file name?

The filename in question is a MAT file that contains elements in the form of "a - bi" where 'i' signifies an imaginary number. The objective is to separate the real, a, and imaginary, b, parts of these elements and put them into two arrays.…
Steve Cho
  • 431
  • 2
  • 5
  • 10
-3
votes
3 answers

Why do you skip void function calls without catching them?

I want to call a function that calculates the width of a circle. #include void area(double*); int main() { void* vp = NULL; double r; printf("input value : "); scanf(" %lf", &r); (double*)vp = &r; void…
주경진
  • 3
  • 1
-3
votes
1 answer

Return multiple values to main function from a for loop in another function in Python

I've read several questions similar to this, but still can't quite figure this out. This should be simple, but I'm not seeing the forest from the trees. I have a for loop in a function as follows: for item in range(len(mf)): fp = fp +…
Ryan
  • 19
  • 9
-3
votes
2 answers

Calling Boolean function in C++

Here is my program, which aims to show whether the input integer is a perfect number or not. It is required to use Boolean function and call it back in main function. However, after running the trial, there is no output. Can anyone help out this…
Paulpaul
  • 11
  • 1
  • 1
  • 2
-3
votes
3 answers

Calling a function multiple times or call it using loop, which is faster?

I need to call a function getCount($stage) multiple times (say 15, since $stage can have values from 0 to 14). Which method is faster: for ($i=0; $i<15; $i++) { getCount($i); } OR getCount(0); getCount(1); . . . getCount(14); ? The current page…
Anoop S
  • 141
  • 1
  • 12
-3
votes
3 answers

Inserting "99" after every prime number in an array (with two functions)

I have some trouble with the parameters (this is my first attempt of using two functions) when constructing the function and calling it. Here is the debugger's error: I:\c++\11_Tombos feladatok-beszuras_torles\19.cpp||In function 'bool…
L. Huni
  • 3
  • 1
-4
votes
1 answer

Javascript function not called

I´ve got a javascript method that calls a php method to get some data in the array "availabletags". To prove if the function is even called, I added availableTags[0] = "Test"; When I put it on my server to try it, nothings happens. So I think the…
Harald
  • 849
  • 3
  • 11
  • 15
-4
votes
1 answer

putting return type in front of swap function call makes it not work(c programming)

Hello so I am learning pointers in c programming right now and I made a basic call by reference swap function that doesn't work as seen below. #include void swap (int *x, int *y) { int temp = *x; *x = *y; *y = temp; } int…
-4
votes
1 answer

False positive "Null Dereference" error in Fortify for function call

I am running Fortify SCA and Applications 21.1.1 on a C project and I'm obtaining a "Null pointer dereference" error in the following line: int parameter1 = 1; char *parameter2; int foo = 1; sprintf(parameter2, "%d", foo); pFunction(parameter1,…
1 2 3
50
51