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 8307787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:36:44+00:00 2026-06-08T18:36:44+00:00

I got a function which wants to send 2 INT parameters back to where

  • 0

I got a function which wants to send 2 INT parameters back to where it has been called, but not sure what would be the best option, a Dictionary ? or a List or an Array

EDITED

I am using .Net framework 2

  • 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-06-08T18:36:47+00:00Added an answer on June 8, 2026 at 6:36 pm

    I assume you mean return 2 values to the caller. If so:

    • return a Tuple<T1, T2>
    • return your own custom type which stores the desired values, like MyOperationResult
    • use out parameters: http://msdn.microsoft.com/en-us/library/t3c3bfhx(v=vs.80).aspx
    • return a collection

    It depends on what is easiest for the caller to understand, i.e. what best demonstrates your intention?

    Returning a variable-size collection may not be intuitive if the result will always have two values. My preference is either a Tuple or a custom type. A Tuple has the advantage of being an existing type, but the disadvantage that it’s not clear what its members mean; they are just called “Item1”, “Item2”, and so on.

    The out keyword is nice for operations which may not succeed and always return a bool, like public bool int.TryParse( string value, out int parsedValue ). Here the intent is clear.

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

Sidebar

Related Questions

I've got a function which parses a sentence by building up a chart. But
I've got a view function that has to decide which form to use depending
I got a function which displays content based on menu options, each time a
I've got a function which takes an input of type ('a * (float *
I've got a function which takes a ArrayList and loads it with strings along
I've got this simple function which displays a message to the user. If I
Ello, ive got the Prolog function member which tells us if an element exists
I've got a function written by another developer which I am trying to modify
I've got a simple function script, the last line of which is to call
I have got a problem with calling a global function, which takes a pointer

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.