Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualnoatom

Posted 29 April 2013 - 02:50 PM

Thanks,got it.I was refering to using that code I showed you instead of a const inside a class.

 

So,Inside the class I could write int es[hey];

 

So should I use enums like that in a class instead of a static const if I need to write code like the array above? I understand that the performance I get by doing this is...very small,but just as a concept,is it better?

 

Ofcourse,I could just use int es[10],but when I need the same constant value in many places in a class,defining an enum like the one above,or a static const,might help understand the code faster.


#2noatom

Posted 29 April 2013 - 02:50 PM

Thanks,got it.I was refering to using that code I showed you instead of a const inside a class.

 

So,Inside the class I could write int es[hey];

 

So should I use enums like that in a class instead of a static const if I need to write code like the array above? I understand that the performance I get by doing this is...very small,but just as a concept,is it better?

 

Ofcourse,I could just use int es[10],but when I need the same constant value in many places in a class,defining an enum like the one above,of a static const,might help understand the code faster.


#1noatom

Posted 29 April 2013 - 02:48 PM

Thanks,got it.I was refering to using that code I showed you instead of a const inside a class.

 

So,Inside the class I could write int es[hey];

 

So should I use enums like that in a class instead of a static const if I need to write code like the array above? I understand that the performance I get by doing this is...very small,but just as a concept,is it better?


PARTNERS