To tylko jedna z 2 stron tej notatki. Zaloguj się aby zobaczyć ten dokument.
Zobacz
całą notatkę
Type conversions • Problem: different types of operands • Solution: conversion to a common type according to a small number of rules. double x, y; int k; y = x + k; • The only automatic conversions are those that convert a ''smaller'' operand into a ''bigger'' one without losing information • Expressions that don't make sense are disallowed - example: using a float as a subscript • Expressions that might lose information may cause a warning, but they legal • Examples: - assigning a long int to an int - assigning floating-point type to an integer
... zobacz całą notatkę
Komentarze użytkowników (0)