how to create 64 bit int, unsigned long long variable with c++
#include <stdio.h>
#include <inttypes.h>
int main(){
uint64_t x = -10033333000;
int64_t y = 113333334445533;
// print x as unsigned variable PRIu64
printf("value of x is: %" PRIu64 ,x);
printf("\n");
// print x as integer variable PRIi64
printf("value of y is: %" PRIi64,y);
printf("\n");
// this is the same like y
unsigned long long z = -212121212121;
printf("value of z is: %llu",z,"\n");
printf("\n");
return 0;
}
gcc int64bit.c -o int64bit
int64bit.c: In function ‘main’:
int64bit.c:8: warning: integer constant is too large for ‘long’ type
int64bit.c:9: warning: integer constant is too large for ‘long’ type
int64bit.c:18: warning: integer constant is too large for ‘long’ type
rex@ubuntu:~/cpp$ ./int64bit
value of x is: 18446744063676218616
value of y is: 113333334445533
value of z is: 18446743861588339495
Bookmark/Search this post with
Similar entries
- mkfs takes very long time, how2 make it faster?
- Include both php/ html files, catch & assign output to a string variable
- Dmoz is dead, long live web 2.0 / social media!
- Argument List too Long
- Check password strength / safety with PHP and Regex
- Image watermark with PHP
- Check password safety with JavaScript while typing
- How to compress/backup just ascii-text files with linux tar
- Drupal warning: array_filter()
- warning: Parameter 1 to comment_nodeapi() expected to be a reference
- How to change 'Welcome to the Frontpage', index-title of Joomla 1.5
- warning: Parameter 1 to admin_menu_admin_menu() expected to be a reference
- Next generation URLs, hostname/id without www and long-keywords
- Delete all spam node entries of a spesific user on a Drupal site with PHP
- CMS experiences with Drupal, Typo3, Joomla and Plone needed
- How to select a secure password for your online logins
- High tech design/ layout rules
- How to add very long text to Drupal 6x?
- Repair all mysql databases-tables with PHP
- Ubuntu or CentOS or Fedora Linux or Debian on a Webserver (LAMP) ?

Comments
Post new comment