Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void g(char c, signed char sc, unsigned char uc)
- {
- c = 255; //implementation-defined if plain chars are signed and have 8 bits
- c = sc; //OK
- c = uc; //implementation-defined if plain chars are signed and if uc's value is too large
- sc = uc; //implementation-defined if uc's value is too large
- uc = sc; //OK: conversion to unsigned
- sc = c; //implementation-defined if plain chars are unsigned and if c's value is too large
- uc = c; //OK: conversion to unsigned
- }
- signed char sc = -160;
- unsigned char uc = sc; //uc == 116 (because 256-160==116)
- cout << uc; //print 't'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement