Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Typedef Pin
Jay0322-Jun-06 8:36
Jay0322-Jun-06 8:36 
GeneralRe: Typedef Pin
Zac Howland22-Jun-06 9:33
Zac Howland22-Jun-06 9:33 
GeneralRe: Typedef Pin
Michael Dunn22-Jun-06 10:43
sitebuilderMichael Dunn22-Jun-06 10:43 
GeneralRe: Typedef Pin
Alexander M.,22-Jun-06 16:04
Alexander M.,22-Jun-06 16:04 
Questionlong data type with 64-bit Pin
Alexander M.,22-Jun-06 6:57
Alexander M.,22-Jun-06 6:57 
AnswerRe: long data type with 64-bit Pin
Zac Howland22-Jun-06 7:01
Zac Howland22-Jun-06 7:01 
AnswerRe: long data type with 64-bit Pin
toxcct22-Jun-06 7:24
toxcct22-Jun-06 7:24 
GeneralRe: long data type with 64-bit [modified] Pin
Zac Howland22-Jun-06 7:29
Zac Howland22-Jun-06 7:29 
toxcct wrote:
on a 64 bits environment : sizeof(int) returns 8


This is not currently the case, and many on the standards committee are arguing against making it so for backwards compatibility reasons. Currently, on 64-bit compilers, sizeof(int) will return 4 (just like on 32-bit compilers). sizeof(long long), which most compilers support and is being discussed as part of the next standard, will return 8. sizeof(void*) will return 8 on a 64-bit compiler.

Note that much of that is still subject to change ... we should know for sure when/if the standard's committee is able to agree on things by 2008.

As a side note, it is best to declare the type of integer you actually want (or typedef it) instead of declaring "int" for precisely this reason. If you need low numbers (less than 255/127), use unsigned char/char; if you need larger numbers, use unsigned short/short; and if you need huge numbers, use unsigned long/long. Finally, on 64-bit systems, if you really need the massive numbers, use unsigned long long/long long. It will help save you some portability issues down the road.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

-- modified at 13:30 Thursday 22nd June, 2006
GeneralRe: long data type with 64-bit Pin
Jörgen Sigvardsson22-Jun-06 11:27
Jörgen Sigvardsson22-Jun-06 11:27 
GeneralRe: long data type with 64-bit Pin
Zac Howland23-Jun-06 3:12
Zac Howland23-Jun-06 3:12 
GeneralRe: long data type with 64-bit Pin
Jörgen Sigvardsson24-Jun-06 9:54
Jörgen Sigvardsson24-Jun-06 9:54 
GeneralRe: long data type with 64-bit Pin
Alexander M.,22-Jun-06 16:01
Alexander M.,22-Jun-06 16:01 
GeneralRe: long data type with 64-bit Pin
Zac Howland23-Jun-06 3:18
Zac Howland23-Jun-06 3:18 
AnswerRe: long data type with 64-bit Pin
Nemanja Trifunovic22-Jun-06 7:41
Nemanja Trifunovic22-Jun-06 7:41 
QuestionHow to merge 2 resource to 1 resource? Pin
xuwenq8822-Jun-06 6:05
xuwenq8822-Jun-06 6:05 
AnswerRe: How to merge 2 resource to 1 resource? Pin
Zac Howland22-Jun-06 6:22
Zac Howland22-Jun-06 6:22 
AnswerRe: How to merge 2 resource to 1 resource? Pin
Tara1422-Jun-06 11:20
Tara1422-Jun-06 11:20 
GeneralRe: How to merge 2 resource to 1 resource? Pin
xuwenq8822-Jun-06 19:48
xuwenq8822-Jun-06 19:48 
GeneralRe: How to merge 2 resource to 1 resource? Pin
Tara1423-Jun-06 0:26
Tara1423-Jun-06 0:26 
QuestionPointer Syntax [modified] Pin
Jay0322-Jun-06 5:59
Jay0322-Jun-06 5:59 
AnswerRe: Pointer Syntax Pin
David Crow22-Jun-06 6:02
David Crow22-Jun-06 6:02 
AnswerRe: Pointer Syntax Pin
Chris Losinger22-Jun-06 6:08
professionalChris Losinger22-Jun-06 6:08 
AnswerRe: Pointer Syntax Pin
toxcct22-Jun-06 6:09
toxcct22-Jun-06 6:09 
GeneralRe: Pointer Syntax Pin
Jay0322-Jun-06 6:24
Jay0322-Jun-06 6:24 
GeneralRe: Pointer Syntax Pin
toxcct22-Jun-06 6:27
toxcct22-Jun-06 6:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.