int main(int argc, char **argv) { unsigned char a = 10, b = 100; std::cout<<sizeof(ab)<<endl; return 1; }
Output: 4
4
What is the return data type?
Arithmetic is always performed, at least with int precision in C ++. a and b rise to int , and the result of the subtraction is of type int .
int
a
b
There is a set of rules used to determine the type used for an arithmetic operation; MSDN has a handy table listing the rules .
Source: https://habr.com/ru/post/887534/More articles:Changing java console output color - javaChange color in java eclipse console - javaSubdomain restriction and exclusion of specific subdomains - ruby | fooobar.comRelevant microcontroller specifications for (very) easy image processing - image-processingC # Production Server, am I collecting garbage? - c #Lucene custom count for numeric fields - luceneUsing Macros in Clojure - macrosMyISAM vs InnoDB for BI / Batch Request Performance (i.e. _NOT_ OLTP) - performanceProblem with strtok and segmentation error - cEmacs Lisp Macro Stepper - macrosAll Articles