intrinsic,primitive types

samuelwhalley's Avatar
Light Poster
When initializing non-static data members of built-in / intrinsic / primitive types, should I use the "initialization list" or assignment.....????
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
These days it does not make much of a difference because PC are more than what the benefit it gives for initialization list and assignments.

At least from practicality point of view I prefer assignments because it makes code cleaner and I don't have to think more when I edit the class with new data members.
0
asadullah.ansari's Avatar, Join Date: Jan 2008
TechCake
Quote:
Originally Posted by shabbir
These days it does not make much of a difference because PC are more than what the benefit it gives for initialization list and assignments.
.
Why you are thinking about only PC. It may be for some other like MPC,i960 etc i.e for embedded OffCourse for inbuilt data type you will not get any benefit of using initialization list. In this case you can use assignment operator. But for user define data types, you should use Initialization list.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I agree but as the thread is in C-C++ forum its expected not to be in that language but yes its not impossible.
0
asadullah.ansari's Avatar, Join Date: Jan 2008
TechCake
Quote:
Originally Posted by shabbir
I agree but as the thread is in C-C++ forum its expected not to be in that language but yes its not impossible.
You are absolutely right for a C++ application running on Pc.
But I am talking in same langauges C++ only but i mean processorlike MPC,i960 etc for embedded software. It's not like core dual, p4 etc.
You are absolutely right

Last edited by asadullah.ansari; 6May2008 at 14:57..