|
| ||||||||||
| Tags: char, function, passing arguments, program |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Passing arguments to a function
Code: MyObject:: myMethod (Program) ( MyMacro (Program); ) |
|
#2
| ||||
| ||||
| Re: Passing arguments to a function
When a function is called, any arguments that are provided by the caller are simply treated as expressions.You never pass a function name to another function, you actually pass function address as argument to another function. When you pass their arguments by reference, which means that the compiler passes a list of addresses pointing to the arguments to be passed. |
|
#3
| |||
| |||
| Re: Passing arguments to a function Code: #include <stdio.h>
void increment(int);
int main(void)
{
int cnt = 6;
increment(cnt);
printf("cnt = %d\n", cnt);
return(0);
}
void increment(int y)
{
++y;
printf("y = %d\n", y);
} |
|
#4
| |||
| |||
| Re: Passing arguments to a function
Call by value : Code: void called_func(int, float);
main(){
called_func(2, 2*3.5);
exit(EXIT_SUCCESS);
}
void
called_func(int g, float arg){
float tp;
tp = g * arg;
} |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Passing arguments to a function" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing XSL value to javascript function | Steadfast | Software Development | 6 | 13-05-2010 11:51 PM |
| Write a file without passing in arguments | Miles Runner | Software Development | 5 | 25-02-2010 02:45 AM |
| Function with a variable number of arguments | Chrisch | Software Development | 3 | 20-11-2009 01:03 PM |
| Passing function parameter and static | Banjiji | Software Development | 3 | 27-10-2009 07:32 PM |
| Calling a function with arguments or parameter in Powershell? | ArunJ | Software Development | 4 | 18-02-2009 04:53 PM |