answersLogoWhite

0

To fulfill the purpose I don't use return but use a different method. pass by references:

#include<stdio.h>

void myFunc(int n[]){

int i;

for(i = 0; i<10; i++)

n[i] = i;

}

int main(void){

int a[10];

int i;

myFunc(a);

for(i=0; i<10; i++){

printf("%d\n",a[i]);

}

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How does the compiler differentiate the statement and function in C programming?

statement should not return a value but function returns a value


What is a function in C programming language?

A function is a subroutine that can be called from several places (re-usable code). Functions can accept arguments (or parameters) so that they can be more generalised and can also return a value to the caller.


Why you use void res in c programming?

since, the word 'void' in C programming language means that it does not return any value to the user or calling function....this is usually used to specify a type of function...... for this reason w use 'void'in c program..


How do you convert numeric value into alpha value in c plus plus programming language?

use the _itoa function


What is accumulator function in c language?

Normally the return value from the function is through the information from the accumulator.


How many types of function in C?

Well, it depends on what you mean by the type of a function. There are user defined functions and library functions.


When a function does not return a value what kind of function is it called?

In most computer languages, a procedure that returns a value is called a function and a procedure that does not return a value is called a subroutine or subprogram. Usually the languages treat the passing of arguments/parameters differently between functions and subroutines. The C language does not distinguish between them. A subroutine that does not return a value is define as a "void" function indicating that no return value is used or available.


What is the difference between a procedure and a function in programming?

In programming, a procedure is a set of instructions that performs a specific task, while a function is a type of procedure that returns a value. Functions are more versatile and reusable because they can be called multiple times and can return a result. Procedures, on the other hand, are used for tasks that do not require a return value.


Difference in using a method that return value and method that does not return value in object orinted programming?

A method that return a value should have a return statement. The method signature should indicate the type of return value. While in the case of a method that does not return a value should not have a return statement and in the signature, the return type is void. When using a method that doesn't return a value, a programmer can not get a value from that function, but instead, it can only change variable values and run other methods.


What is return in programming?

The return statement is used in functions to return control to the caller. If the function is declared non-void, the return statement also allows the programmer to return a value to the caller.


How do you use return?

In C/C++ programming and most other procedural languages, you use a return statement to return control to the calling function. In the case of the global main function, a returnstatement terminates the program, releasing all memory used by the program and returning control to the execution environment.Functions that return void do not return a value and therefore do not require a return statement, unless the function needs to return early (before falling off the end of the function). Functions that return values must use a returnstatement to return the appropriate value to the caller.In C++ (but not in C), the global main function does not require a return statement unless returning early. When omitted, the global main function implicitly returns the value 0 (to the execution environment) when execution falls off the end of the function. To return any other value, a return statement is required.


How do you return a value in a PHP function?

Below is a simple example of how you could return a value in a PHP function. &lt;?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?&gt;