Difference Between Call By Value and Call By Reference?
Answers were Sorted based on User's Feedback
Answer / kruthicse
Call By Value:
Creates a new memory loaction for use within the
subroutine.The memory is freed once it leaves the
subroutine.Changes made to the variable are not affected
outside the subroutine.
Call By Reference:
Passes a pointer to the memory location.Changes made to the
variable within the subroutine affects the variable outside
the subroutine.
| Is This Answer Correct ? | 580 Yes | 131 No |
IN CALL BY VALUE, BOTH THE ACTUAL AND FORMAL PARAMETERS
WILL BE CREATED IN DIFFERENT MEMORY LOCATIONS WHEREAS IF
THEY ARE CALLED BY REFERENCE BOTH WILL BE CREATED AT THE
SAME LOCATION.
| Is This Answer Correct ? | 369 Yes | 123 No |
Answer / ashish awasthi
in call by value method,a compiler get a copy of the
variable and thus changes made in the value in function
will not reflected back to the called function.but in call
by reference method,the compiler didn't get any copy ,but
actually it works on the original copy and thus changes
will be reflected back
| Is This Answer Correct ? | 261 Yes | 59 No |
Answer / shrikant patil
Call by value method:
passing the value of variable to the function.
void main()
{
int x=10,y=20;
printf("%d%d',x,y);
swap(x,y);
}
void swap(int a,int b)
{
int c;
c=a;//changes here do not affect in values
a=b;//of x and y in main function..
b=c;
}
call by reference method:
passing the address of variable to the function.
swap(&a,&b)
&c=&a;
&a=&b;
&b=&c;
changes made in subfunction causes changes in address of
variables n thus in main () also..
| Is This Answer Correct ? | 155 Yes | 33 No |
Answer / vinay kumar gupta
call by value :
call by value means programmer send some value coping from
one function to another.At the time of function calling a
programmer can send a copy of variable of value.
call by referance :
it means sending sending the address of variable to the
called function means a user can send the address of variable.
| Is This Answer Correct ? | 181 Yes | 65 No |
Answer / maqbul
call by value :
call by value means programmer send some value coping from
one function to another.At the time of function calling a
programmer can send a copy of variable of value.
call by referance :
it means sending sending the address of variable to the
called function means a user can send the address of
variable.
| Is This Answer Correct ? | 109 Yes | 33 No |
Answer / shikesho padjowike
call by value is a technique whereby the called function
receives value from its calling function, stores this value
in its local arguments andd return a result.
call by reference is a technique whereby a calling gives
access of its local variables to the called function.
| Is This Answer Correct ? | 96 Yes | 27 No |
Answer / dhiren
IN CALL BY VALUE, BOTH THE ACTUAL AND FORMAL PARAMETERS
WILL BE CREATED IN DIFFERENT MEMORY LOCATIONS WHEREAS IF
THEY ARE CALLED BY REFERENCE BOTH WILL BE CREATED AT THE
SAME LOCATION ANDit is sending the address of variables to the called function .
| Is This Answer Correct ? | 77 Yes | 28 No |
Answer / soumya.tavildar
call by value :
The copy of the argument is passed. e,g., if x and y are arguments and their corresponding values are say 100 and 200.
c=max(x,y);
max(inta,intb)
call by referance :
it is sending the address of variables to the called function.
| Is This Answer Correct ? | 89 Yes | 41 No |
Answer / sadikhasan
Call By Value :
In call By Value it create different memory for local
variable and actual called Variable. so changes does not
affect to the actual variable.
Call By Reference:
In call By Reference Compiler create same memory location
for the local variable and actual called variable so changes
affect to the actual variable and modify the value of actual
called Variable.
| Is This Answer Correct ? | 43 Yes | 12 No |
what is the Currency and Quantity field in BDC?
how can we print both side in smartforms?
Types of windows in SAP scripts?
9 Answers vCentric Technologies,
What is BDC?
Can ‘where’ clause be used when updating database entries?
Which type of tables used this buffer?
what is the event while entering data in screen to get next field.
Give few names of cluster tables in sap? Give few names of pooled tables in sap? give few names of transparent tables?
What is the use of 'for all entries'?
while running bdc for call transaction method, in gui_upload function we use filetype 'ASC' for tab delimited seperated data. like that for csv(comma delimited) data what we have to use as filetype??? ie FILETYPE = ?????
what are Joins? How many types are there?
Among "Move" and "Move Corresponding", which is efficient one?
SAP Basis (1262)
SAP ABAP (3939)
SAPScript (236)
SAP SD (Sales & Distribution) (2717)
SAP MM (Material Management) (912)
SAP QM (Quality Management) (99)
SAP PP (Production Planning) (523)
SAP PM (Plant Maintenance) (252)
SAP PS (Project Systems) (138)
SAP FI-CO (Financial Accounting & Controlling) (2766)
SAP HR (Human Resource Management) (1180)
SAP CRM (Customer Relationship Management) (432)
SAP SRM (Supplier Relationship Management) (132)
SAP APO (Advanced Planner Optimizer) (92)
SAP BW (Business Warehouse) (896)
SAP Business Workflow (72)
SAP Security (597)
SAP Interfaces (74)
SAP Netweaver (282)
SAP ALE IDocs (163)
SAP Business One (110)
SAP BO BOBJ (Business Objects) (388)
SAP CPS (Central Process Scheduling) (14)
SAP GTS (Global Trade Services) (21)
SAP Hybris (132)
SAP HANA (700)
SAP PI (Process Integration) (113)
SAP PO (Process Orchestration) (25)
SAP BI (Business Intelligence) (174)
SAP BPC (Business Planning and Consolidation) (38)
SAP BODS (Business Objects Data Services) (49)
SAP BODI (Business Objects Data Integrator) (26)
SAP Ariba (9)
SAP Fiori (45)
SAP EWM (Extended Warehouse Management) (58)
Sap R/3 (150)
SAP FSCM Financial Supply Chain Management (101)
SAP WM (Warehouse Management) (31)
SAP GRC (Governance Risk and Compliance) (64)
SAP MDM (Master Data Management) (0)
SAP MRS (Multi Resource Scheduling) (0)
SAP ESS MSS (Employee Manager Self Service) (13)
SAP CS (Customer Service) (0)
SAP TRM (Treasury and Risk Management) (0)
SAP Web Dynpro ABAP (198)
SAP IBP (Integrated Business Planning) (0)
SAP OO-ABAP (Object Oriented ABAP) (70)
SAP S/4 HANA Finance (Simple Finance) (143)
SAP FS-CD (Collections and Disbursements) (0)
SAP PLM (Product Lifecycle Management) (0)
SAP SuccessFactors (33)
SAP Vistex (0)
SAP ISR (IS Retail) (28)
SAP IdM (Identity Management) (0)
SAP IM (Investment Management) (0)
SAP UI5 (59)
SAP SCM (Supply Chain Management) (51)
SAP XI (Exchange Infrastructure) (49)
SAP Cloud Platform (34)
SAP Testing (89)
SAP SolMan (Solution Manager) (63)
SAP MaxDB (116)
SAP GUI (15)
SAP AllOther (329)