cs31 lecture 17

Typeexpression example float x float2 3 97 arrays x

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: match when using integer promotion and/or There floating point promotion floating 3. There is a signature match when using system type conversion 4. There is a signature match when using user-type conversion There (objects)
 (objects)
 5. There is a signature match with a signature containing ellipsis 93 Exact match x Simple: the signature of the call and the signature of the Simple: function fully matches function Ex: Ex: int foo(int x, int y)
 { return 0; } int int main()
 { int x = foo(2, 3)
; int } 94 Match within the same predefined type class x The signature matches up to short-to-int, or float-to-double The conversion conversion Ex: Ex: int foo(int x, int y)
 { return 0; } int int main()
 { short z = 3; short int x = foo(2, z)
; int } 95 Match with promotion on predefined types x The signature matches up to int-to-float, or float-to-int The conversion conversion Ex: Ex: int foo(float x, float y)
 { return 0; } int int main()
 { int z = 3; int int x = foo(2, z)
; int } 96 Forcing a type promotion: type cast x In C and C++, the type of...
View Full Document

This note was uploaded on 04/03/2014 for the course CS 31 taught by Professor Melkanoff during the Fall '00 term at UCLA.

Ask a homework question - tutors are online