Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: What can I use in java instead of "ref" in C?

  1. #1
    Junior Member
    Join Date
    Aug 2018
    Posts
    2
    My Mood
    Cool
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up What can I use in java instead of "ref" in C?

    Hi,

    You can see below code taken from C.

    value = DecodeFirstBlock(valuese, sysid, strid, ref timecode, ref datecode, ref sample_rate, ref k);

    What does it mean "ref"? I searched in web for this. But I did not find anything.
    Could you please help me?
    Thank you...

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,165
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: What can I use in java instead of "ref" in C?

    Can you explain what the word "ref" means as used in that statement? What does it do to the argument that is being passed to the method?

    This looks like a question for a c forum, not for java.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Aug 2018
    Posts
    2
    My Mood
    Cool
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: What can I use in java instead of "ref" in C?

    Maybe I wrote it wrong. I m working on java.

    private int DecodeFirstBlock(int[] dataval, char[] sys, char[] str, ref uint time, ref uint date, ref byte sps, ref int count){
        //some code line
    }

    You know if you define a variable in java, you can use int, String or byte. but in the above code block "ref byte sps" made in the form of identification. In here sps is variable. What does it mean "ref byte" before the sps?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,165
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: What can I use in java instead of "ref" in C?

    What does it mean "ref byte"
    I don't know. It is not java.
    Have you tried asking on a c forum or whatever language that code is written in?

    Have you tried writing java code without the "ref"? What happened?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member tonya's Avatar
    Join Date
    Feb 2018
    Posts
    16
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: What can I use in java instead of "ref" in C?

    What does it mean "ref byte"
    I think this is actually C# code, I found this explaining the ref keyword
    https://stackoverflow.com/questions/...-pointers-in-c

Similar Threads

  1. Replies: 1
    Last Post: June 21st, 2017, 04:58 PM
  2. Replies: 6
    Last Post: August 16th, 2014, 01:34 AM
  3. Replies: 2
    Last Post: May 22nd, 2014, 01:17 PM
  4. Replies: 2
    Last Post: June 22nd, 2013, 10:30 AM
  5. Replies: 7
    Last Post: August 13th, 2011, 01:22 AM