I like to have my code warning free for VS.NET and GCC, and I like to have my code 64-bit ready.
Today I wrote a little module that deals with in memory ... |
Is there a reliable way to declare typedefs for integer types of fixed 8,16,32, and 64 bit length in ISO Standard C?
When I say ISO Standard C, I mean that strictly:
|
I am aware that the specification of the C language does not dictate the exact size of each integer type (e.g., int).
What I am wondering is: Is there a way in ... |
I am getting confused with size_t in C.
I know that it is returned by the sizeof operator.
But what exactly it is? Is it a datatype?
Let's say I have a for loop ... |
Im working on a sparetime project, making some server code to an Arduino Duemilanove, but before I test this code on the controller I am testing it on my own machine ... |
stdint.h in C99 provides many options for integer sizes, types and ranges - so many I don't know what ones to choose!
I know how to use size_t ... |
(This question came out of explaining the details of CHAR_BIT, sizeof, and endianness to someone yesterday. It's entirely hypothetical.)
Let's say I'm on a platform where CHAR_BIT is 32, so sizeof(char) == ... |
|
Size of the integer depends on what?whether it is compiler dependent or machin dependent?
|
The C standard guarantees that an int is able to store every possible array size. At least, that's what I understand from reading ยง6.5.2.1, subsection 1 (Array subscripting constraints):
One ... |
Possible Duplicate:
integer size in c depends on what?
Why is the size of an integer 2 bytes on a 16-bit compiler and 4 bytes on ... |
According to numerous answers here, long and int are both 32 bits in size on common platforms in C and C++ (Windows & Linux, 32 & 64 bit.) (I'm aware ... |
I've tried using the following command:
__m128i b = _mm_set_epi32 (y, y, x, x);
Where y and x are ints.
Where I run the debugger I see that b is of type: unsigned ... |
The size of a char is always 1 byte, the C standard guarantees that. The number of bits in a byte is platform dependent. The size of int should be the size that is most efficient for the platform to process (16 bits on a 16 bit processor etc) but that is not always the case. For this post the platform ... |
For eg : struct mesh { size_t nvert; /* number of vertices */ size_t ntri; /* number of triangles */ ..... }; The reason I want to use size_t is because I've read that it is capable of supporting size of the largest possible integer in the C implementation. In my case, the value of nvert can vary from any thing ... |
thats what i study in my theorotical books. But i am confused and bowled!!! Turbo C on XP.....sizeof int = 2 visual c++ on XP..sizeof int = 4 turbo C++ on XP ...size of int =4 gcc on linux size of int = 4 ..... i am also confused with running turbo C on DOC is it because of that it ... |
Hi, Could someone tell me what's wrong with the following program? I think there is something wrong with the size of integers I'm using, but not sure. When I execute it, I get the following output, but the value of r in 3 should be 0x000BFD0600000000. Thanks, Andre ************************************************** ********************* 1: 0000000000000000 2: 00000000000BFD06 3: 0000000000000000 4: 00000000A28B24BD timeLow: A28B24BD timeHigh: ... |
Frederick Gotham On modern 32-Bit PC's, the following setup is common: char: 8-Bit short: 16-Bit int: 32-Bit long: 32-Bit "char" is commonly used to store text characters. "short" is commonly used to store large arrays of numbers, or perhaps wide text characters (via wchar_t). "int" is commonly used to store an integer. "long" is commonly used to store an integer greater ... |
Bob Hairgrove wrote in message ...[color=blue] >On Tue, 21 Mar 2006 17:22:06 +0100, glen stark >wrote:[color=green] >>Surely there is something clever to do here, besides turning off the >>warning?[/color] > >Yes. Instead of writing this: > vector v; > // fill the vector here... > for (int i=0; i >write this: > for (size_t i=0; ... |
That warning SPECIFICALLY says that "size_t" and "int" (or "unsigned int") aren't the same size, so obviously, your assumption about them being the same size is NOT true in this case. You will find that if you look in crtdbg.h, that there are TWO places where size_t is defined, one place where it's defined to "_W64 unsigned int" and once where ... |
|
|
|
__________________ Right 98% of the time, and don't care about the other 3%. It has been said that the great scientific disciplines are examples of giants standing on the shoulders of other giants. It has also been said that the software industry is an example of midgets standing on the toes of other midgets. (Alan Cooper) |
|
|