Type Conversion/Casting Confusion in C++
问题 What is Type Conversion and what is Type Casting ? When should I use each of them? Detail: Sorry if this is an obvious question; I'm new to C++, coming from a ruby background and being used to to_s and to_i and the like. 回答1: Conversion is when a value is, um, converted to a different type. The result is a value of the target type, and there are rules for what output value results from what input (of the source type). For example: int i = 3; unsigned int j; j = i; // the value of "i" is