Type conversions - overview

Nasza ocena:

Wyświetleń: 420
Komentarze: 0

Pobierz ten dokument za darmo

Podgląd dokumentu
Type conversions  - overview - strona 1 Type conversions  - overview - strona 2

Fragment notatki:

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)

Zaloguj się, aby dodać komentarz