justforasking's blog

By justforasking, history, 21 month(s) ago, In English

Can anyone tell me how to include this micro #define int long long int, this is giving error because its also converting int main to long long int main

  • Vote: I like it
  • +6
  • Vote: I do not like it

| Write comment?
»
21 month(s) ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

change int main() to int32_t main() or signed main()

»
21 month(s) ago, # |
  Vote: I like it +16 Vote: I do not like it

Just dont use #define int long long:)

»
21 month(s) ago, # |
  Vote: I like it +21 Vote: I do not like it

These guys trap hackers by fooling them for overflow.

»
20 months ago, # |
Rev. 2   Vote: I like it -16 Vote: I do not like it

!

  • »
    »
    20 months ago, # ^ |
      Vote: I like it +23 Vote: I do not like it

    did you really have to revive this post for mentioning again what I already did 5 weeks ago

»
20 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

If you want to use this you should change int main() to signed main().

However it is not a good idea to use #define int long long.

»
20 months ago, # |
  Vote: I like it +7 Vote: I do not like it

just use signed main()

»
20 months ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

This is actually discouraged because it dramatically increases the running time as you enabled 64-bit processing for unnecessary variables.

»
20 months ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

poll!

use #define int long long

don't use

  • »
    »
    20 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I would suggest not to use it, macros are a massive garbage feature imo, they're unsafe and makes your code bound to have bugs here and there (no exception to #define int long long, it breaks C++ style type conversion)