top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Why unsigned int64_t i gives an error?

+1 vote

Why the following program gives an error?

#include <stdio.h>

int main() 
    unsigned int64_t i = 12;
    printf("%lld\n", i);
    return 0;


 In function 'main':
5:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'i'
  unsigned int64_t i = 12;
5:19: error: 'i' undeclared (first use in this function)
5:19: note: each undeclared identifier is reported only once for each function it appears in

But, If I remove the unsigned keyword, it's working fine. So, Why unsigned int64_t i gives an error?

posted Jun 19 by Mahedra Chaudhari

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+2 votes
Best answer
  1. These are not standard C notation so you need include stdint.h to compile it.
  2. int64_t is by default a signed one of so you cant apply unsigned to it, to make it unsigned you may need to use uint64_t.

PS: unsigned modifier works only on char, short, int, long, and long long.

answer Jun 19 by Salil Agrawal
Similar Questions
+1 vote
1)double d=0786; 

2)double d=0x4b17;

Useful Links with Similar Problem
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.