Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Query About Passing values Posted by VijayLenka on 19 Nov 2012 at 12:12 AM
Hi..can anybody tel me that how the output would be changed for same input depending upon the method of passing values/reference/name etc.to a function?For example consider the folloing code

procedure exchange(A:integer,B:integer)
temp:integer;
begin
temp:=A;
A:=B;
B:=A;
end
begin
M:=2;X[M]=4;
exchange(M,X[M]);
write(M,X[2]);
end

what is the output for the above code when
1)If the parameters are passed by value
2)If the parameters are passed by reference
3)If the parameters are passed by name

Please help me to find out this...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.