Table of Contents

Advertisement

{
return a-10;
}
The return value is within the function stated as instruction "return Expression". If there is a function
of the void type then the return instruction can be used without parameters in order to leave the
function.
References
Since it is not possible to pass on arrays as parameters the access to parameters is possible
through references. For this a pair of brackets is written after the parameter names in the parameter
declaration of a function.
int StringLength(char str[])
{
int i;
i=0;
while(str[i]) i++;
return(i);
}
void main(void)
{
int len;
char text[15];
text="hello
len=StringLength(text);
}
In main the reference of text is presented as parameters to the function StringLength. If in a function
a normal parameter is changed then the change is not visible outside this function. With references
this is different. Through parameter str in StringLength the contents of text can be changed since str
is only the reference (pointer) to the array variable text.
Presently arrays can only be passed "by Reference"!
5.2.8

Tabellen

5.2.8.1
Operator Precedence
© 2008 Conrad Electronic
// repeat character as long as unequal zero
world";
Rang
Operator
13
( )
12
++ -- !
11
*
/
10
+
-
~
-
(negatives Vorzeichen)
%
Compiler
104

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the C-Control Pro Mega Series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

C-control pro mega32C-control pro mega128

Table of Contents