C
C# Learner
With code like this:
public void SomeMethod()
{
for (int i = 0; i < SomeLargeNumber; ++i) {
int n = GetANumber();
DoSomethingWith(n);
}
}
Would the "int n" part be optimized out somewhere along the line?
i.e.: would something like the following happen instead:
public void SomeMethod()
{
int n;
for (int i = 0; i < SomeLargeNubmer; ++i) {
n = GetANumber();
DoSomethingWith(n);
}
}
Just curious...
public void SomeMethod()
{
for (int i = 0; i < SomeLargeNumber; ++i) {
int n = GetANumber();
DoSomethingWith(n);
}
}
Would the "int n" part be optimized out somewhere along the line?
i.e.: would something like the following happen instead:
public void SomeMethod()
{
int n;
for (int i = 0; i < SomeLargeNubmer; ++i) {
n = GetANumber();
DoSomethingWith(n);
}
}
Just curious...