0

Can someone please help me to create a circular reference
I need to add a to b and b to a. I've been looking everywhere can this be accomplished with enum or structs?

Please help me

2
Contributors
11
Replies
12
Views
7 Years
Discussion Span
Last Post by dnanetwork
0

two values are used to calculate each other
e.g a = b + c
b = a + d
this is called a circular reference.

0

Run this and tell me it's not working...

int a, b, c, d;
        a = 10;
        b = 15;
        c = 12;
        d = 14;

        a = b + c;
        b = a + d;

        Response.Write("value of a : " + a + "<br />");
        Response.Write("value of b : " + b + "<br />");
0

my b is using a's final answer..
could you be kind to run this code..
and setup a debug...and see the values..

0

my answers are:
a = 27
b = 41

you assigned 15 to b and 12 to c = 27
I need the e.g(41) for b

0

dude B is returning 41...
i'm not sure wot is your problem..?

wot should be your expected output..
after my calculation..

wot do u expect the value a & b?

0

with these answers:
a = 27
b = 41

the calculation should then be
a = 41 + 12
b = 27 + 14

0

no it's not gonna happen
cos you are changing the B's value after a's calculation..

int a, b, c, d;
        a = 10;
        b = 15;
        c = 12;
        d = 14;

        a = b + c;
        b = a + d;
       [B] a = b + c;[/B]


        Response.Write("value of a : " + a + "<br />");
        Response.Write("value of b : " + b + "<br />");

add this lil modification...
one last question..do u know wot u doin bro..!

Edited by dnanetwork: n/a

0

No that won't work, what I'm trying to do is called circular reference where values depend on each other in a calculation.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.