Register keyword


if i have a 2 different functions f1() and f2(), f1 has an optimised variable (using register) and f2 has 500 optimised variables, is it true to say that

A) calling f2() then f1() may mean that the optimised variable in f1 may not be optimised because f2 may had exhausted all possible optimisations possible

B) calling f1() then f2() will mean that the optimised variable in f1 is surely optimised (because there is only one)
if i have a given homework/test... is it true to say that...

A) We will not answer,,,

B) Fool Around On This...
The "register" keyword is meaningless to modern, optimizing compilers and is usually ignored.
Really? It doesn't tend to work any more?

What the register keyword actually does, in case OP doesn't know, is hint to the compiler to try and store a variable in a register where possible. I don't see the point in using it, though. The compiler decides where to put variables; it can use them entirely through registers if it wants to anyway. The compiler is usually better at optimizations like that...
http://msdn.microsoft.com/en-us/library/482s4fy9%28VS.80%29.aspx

The "Microsoft Specific" section could just as easily read "what pretty much everyone does these days"...

ok i guess this question is purely academic..
Topic archived. No new replies allowed.