Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   intrinsic,primitive types (http://www.go4expert.com/forums/intrinsicprimitive-types-t10401/)

samuelwhalley 5May2008 21:32

intrinsic,primitive types
 
When initializing non-static data members of built-in / intrinsic / primitive types, should I use the "initialization list" or assignment.....????

shabbir 6May2008 09:09

Re: intrinsic,primitive types
 
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.

asadullah.ansari 6May2008 09:41

Re: intrinsic,primitive types
 
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.

shabbir 6May2008 10:08

Re: intrinsic,primitive types
 
I agree but as the thread is in C-C++ forum its expected not to be in that language but yes its not impossible.

asadullah.ansari 6May2008 11:37

Re: intrinsic,primitive types
 
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


All times are GMT +5.5. The time now is 05:43.