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]);
}
}
statement should not return a value but function returns a value
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..
use the _itoa function
Normally the return value from the function is through the information from the accumulator.
Well, it depends on what you mean by the type of a function. There are user defined functions and library functions.
statement should not return a value but function returns a value
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.
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..
use the _itoa function
Normally the return value from the function is through the information from the accumulator.
Well, it depends on what you mean by the type of a function. There are user defined functions and library functions.
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.
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.
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.
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.
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.
Below is a simple example of how you could return a value in a PHP function. <?php function returnme($value) { return $value; } echo returnme('hello'); // outputs: hello ?>