Of course nFint will be zero. What else were you expecting? nFint won't change when m changes, so if you change m to something else later, nFint will still be zero.
Okay, what's going on is obviously not in the portion of code that you've posted. We need more verbose information...like everything that you're doing that has any effect on m of nFint. Assignments, functions, operations, everything.
Of course nFint will be zero. What else were you expecting? nFint won't change when m changes, so if you change m to something else later, nFint will still be zero.
m has changed later. I did not write that because I put the output. So m has changed to 180 but assingment to nFint doesn't work.
Okay, what's going on is obviously not in the portion of code that you've posted. We need more verbose information...like everything that you're doing that has any effect on m of nFint. Assignments, functions, operations, everything.
I don't see any external process but I'll check again.
I think it is because "const int nFint = m;" is never compiled because it is not in a function. But when I put the assingment inside a function it gives LINK error. For example, if I put the assingment inside fnc1 (see below) then it will be compiled but as I said gave LINK error in this case.
We already fixed your problem. The problem was
1) You can't change a const.
2) You changed m without telling us about it.
:) Because I posted the output in the first post I expected from you to understand that m is changing. OK, my fault. But as I said I also tried without const and did not work.
Even if nInt wasn't const, it won't change values along with m unless you explicitly set it equal to m every time m changes.
This.
It doesn't matter if you change m, nFint is initialized with whatever m at the time of initialization. Changing m after that means absolutely nothing to nFint.
If you want nFint to "echo" m, then you want to make it a reference:
constint& nFint = m; // <- note the & to make it a reference
This way, nFint and m are the same variable, so they will always equal each other.