Friday, July 16, 2010

Initialization vs. Assignment

Initialization and assignment are two distinct operations in both C and C++, yet they have the similar outcome, that is why the distinctions are confusing. The difference is more clear in C++. In C argument passing is assignment but in C++ argument passing is initialization; similarly, function return is an assignment in C but an initialization in C++. There are situations where initialization and assignment have different outcomes one example is working with references.

No comments:

Post a Comment