C
Chad
I'm not too sure if this is the right forum to ask the following
question.
Given the following code
#include <stdio.h>
int main(void)
{
int a=5;
int b=6;
int c, i;
for(i=0; i< 30; i++) {
c = a * b;
}
return 0;
}
Now let's assume the values of a and b never change. Each time the
'for' loop executes in the above code, a and b gets multiplied. If I
would change the value of c to register, would the values of and b get
cached? Ie not get re-loaded into the memory everytime the for loop
gets executed.
Chad
question.
Given the following code
#include <stdio.h>
int main(void)
{
int a=5;
int b=6;
int c, i;
for(i=0; i< 30; i++) {
c = a * b;
}
return 0;
}
Now let's assume the values of a and b never change. Each time the
'for' loop executes in the above code, a and b gets multiplied. If I
would change the value of c to register, would the values of and b get
cached? Ie not get re-loaded into the memory everytime the for loop
gets executed.
Chad