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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:47:13+00:00 2026-06-10T01:47:13+00:00

I have two .cs files ( Hex2Bin.cs and Program.cs ) and I want to

  • 0

I have two .cs files (Hex2Bin.cs and Program.cs) and I want to pass the variable end_addr from Program.cs to Hex2Bin.cs

My code in Program.cs:

class Program
{
    enum to_exit {
        exit_ok = 0,
        exit_invalid_args,
        exit_to_few_args,
        exit_invalid_input_file,
        exit_invalid_args_file,
        exit_permission_denied,
        exit_unexpected_eof
    };

    // class value holders
    static String args_file_name = "";
    static String in_u1_name = "";
    static String in_u22_name = "";
    static String out_name = "";
    static short end_addr = 0x0000;                 // 4-digit Hexadecimal end address
    static Byte[] version_code = { 0, 0, 0, 0 };    // 3 bytes version, 1 for extra info
}

Is there anyway I could do this? I know how to do it in c, but I’m very new to c#. Thanks.

  • 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-10T01:47:14+00:00Added an answer on June 10, 2026 at 1:47 am

    if you declare the variable like this:

    public static short end_addr = 0x0000;
    

    then from another class you can use it like this:

    Program.end_addr
    

    but don’t do this, is not object oriented!

    if your class Hex2Bin is used/invoked by the Main method of Program class, you should be able to pass your variables as input parameters of the methods you call or set them as properties of the classes/objects you use…

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

Sidebar

Related Questions

I have two files from a C program. I guess both belong to quite
I have two files: public interface PrintService { void print(PrintDetails details); class PrintDetails {
I have two files. I want to create pdf with these two files. does
I have two files: index.php /lib/user.php Index contains the form: <div class=<? echo $msgclass;
I have two files: logic.scala and main.scala logic.scala contains one class and main.scala have
I have two files: a.py b.py How can I access my ABC123 class defined
I have two files A and B. I want to find all the lines
I have two files which the order of lines is irrelevant, and I want
I have two files, and want to combine/overwrite whole nodes based on a particular
I have two files checked into GitHub: index.html backup.html Now I want to rename

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.