Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7084907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:21:35+00:00 2026-05-28T07:21:35+00:00

I wish to understand more about parameter parsing. I have an example with the

  • 0

I wish to understand more about parameter parsing. I have an example with the code below.
What the results if I pass parameter by:
* Value
* Reference
* Name

procedure f (x, y, z)
x := x + 1
y := z
z := z + 1

i := 0; a[0] := 10; a[1] := 11

f (i, a[i], i)

print i, a[0], a[1]

If I understood it correctly the results are:

By Value: 1, 11, 12

By Reference: 2, 12, 10

By Name: 1, 10, 0

Am I in the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:21:36+00:00Added an answer on May 28, 2026 at 7:21 am

    I’ll give you a partial answer

    when you pass by value, you pass a copy of your variable, so your variable can’t be changed by the function.
    so the answer of by value should be 0,10,11 which are the initial values of i, and the array.

    when you pass by reference it will change your values :
    the first line will change i to 1;
    the second line will change a[0] to 1;
    the third line will change i to 2;
    which means it will print 2,1,11

    i never herd about passing by name.

    hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started using Scala and wish to better understand the functional approach
Really wish i was God, then I would understand what this means: The element
I wish to know all the pros and cons about using these two methods.
I wish to search a database table on a nullable column. Sometimes the value
I guess this query is a little basic and I should know more about
I wish to understand the way kernel works when a user/app tries to create
I have an Async method returning a Task. I also wish to offer a
I wish to learn/understand/use a version control. Do you know any good video tutorial?
I have a set of classes I wish to serialize the data from. There
I wish to write a function that operates on any value that can be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.