Change integer type in C++

Revision en3, by RHandarov, 2018-02-03 21:01:29

Hi Codeforces, I ask for help. Can I make a variable which is int type, but when it overflow, it convert to long long type. For example I make an integer variable x. I give max integer value on x. When I add 1 to x, I do not want to overflow. I want to make ( auto convert to) long long and continue with next number. Is it possible? I am sorry if I ask a stupid question.

Tags c++, data types

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English RHandarov 2018-02-03 21:01:29 19 Tiny change: 't to make long long' -> 't to make ( auto convert to) long long'
en2 English RHandarov 2018-02-03 20:48:16 1 Tiny change: 'ow, it con vert to lo' -> 'ow, it convert to lo'
en1 English RHandarov 2018-02-03 20:42:57 381 Initial revision (published)