LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-18-2006, 09:12 PM   #1
bbengg
LQ Newbie
 
Registered: May 2006
Posts: 5

Rep: Reputation: 0
Post How can I support 64bit data type?


Hello!

I need to support 64bit data type(like int64)with gcc compiler. Is there any option to do this?

thank you.
 
Old 05-19-2006, 04:22 AM   #2
pxumsgdxpcvjm
Member
 
Registered: Aug 2005
Posts: 235

Rep: Reputation: 30
It's called "long long". The unsigned version is called (obviously) "unsigned long long".
Thus if you have declared "long long n", then n can store values in [-2^63,2^63) (signed), or in [0,2^64) (unsigned).

If you're using C, then "long long" is part of the standard (C99) and is the official name for it.
If you're using C++, then C++ has no standard 64-bit integer datatype, but most compilers support it. The M$ compilers call it int64, I guess, and gcc calls it "long long". (Also, it is quite likely that 64-bit integer datatypes will become part of the C++ standard the next time a standard is discussed, and it will be called long long.)
 
Old 05-21-2006, 10:22 PM   #3
bbengg
LQ Newbie
 
Registered: May 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you for your help!!
The long long data type works well in my system.
But it takes some time to verify it.
Because I cannot print long long data type using "printf()" function.
I think printf() do not support long long data type. So, I print it using bit shift like below. ^^

unsigned long long value ;
value = 0xffffffffff;
printf("value %08x%08x\n", (int)(value>>32), (int)value);
 
Old 05-21-2006, 10:58 PM   #4
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by bbengg
Thank you for your help!!
The long long data type works well in my system.
But it takes some time to verify it.
Because I cannot print long long data type using "printf()" function.
I think printf() do not support long long data type. So, I print it using bit shift like below. ^^

unsigned long long value ;
value = 0xffffffffff;
printf("value %08x%08x\n", (int)(value>>32), (int)value);
The "%lld" (or "%llu" for unsigned) format specifier should work. Have you tried it?

Last edited by daihard; 05-21-2006 at 11:00 PM.
 
Old 05-21-2006, 11:32 PM   #5
bbengg
LQ Newbie
 
Registered: May 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks a lot.
That specifier works well.

I have a question. I cannot find that specifer by using "man" and "info" command.
Where can i find it in detail? I hope I can find it in web site.

Thanks.
 
Old 05-21-2006, 11:40 PM   #6
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by bbengg
Thanks a lot.
That specifier works well.

I have a question. I cannot find that specifer by using "man" and "info" command.
Where can i find it in detail? I hope I can find it in web site.
I found those specifiers in the man page.

Simply running "man printf" yields information on the shell printf command. Try running "man 3 printf" instead.
 
Old 05-22-2006, 02:55 AM   #7
bbengg
LQ Newbie
 
Registered: May 2006
Posts: 5

Original Poster
Rep: Reputation: 0
You are right. I checked it. Thanks you
 
Old 05-22-2006, 11:04 PM   #8
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by bbengg
You are right. I checked it. Thanks you
You're welcome. Glad I was able to help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
32 Bit Application Support on a 64Bit OS/Hardware i2tall2c Red Hat 0 04-18-2006 02:32 PM
FlashPlayer & SUSE 10.0 64bit architecture support riba43 SUSE / openSUSE 8 11-09-2005 06:29 PM
multipling 64bit data type in assembly irfanhab Programming 3 12-06-2004 04:41 PM
64bit support with existing drivers? xemophora Linux - Hardware 1 12-29-2003 07:56 AM
Data Type 9 bob Linux - Newbie 1 02-10-2001 08:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration