» Home » unsigned » Page 1
No match for call to '(std::pair<unsigned int, unsigned int>) (unsigned int&, unsigned int)'
by RockinZ28 in Programming Languages

I don't know what's wrong with the follwing code, it should read numbers and put their value with the position together in a vector of pairs and then sort them and print out the positions. I removed the part with sort - i thought the problem was there, but i received an error on compilation again.

#include <iostream>

'int i' is declared as unsigned but the compiler does not give error and gives output as -121 (Range of unsigned int is positive.)
by jald in Web Design

Analyze the following code...
'int i' is declared as unsigned but the compiler does not give error and gives output as -121 (Range of unsigned int is positive.)
Please suggest the reason.

void main()
unsigned int i=-121;

Pros and cons of ways of storing an unsigned int without an unsigned int data type
by Prasant Jain in Web Design

I have values that are 64-bit unsigned ints, and I need to store them in mongodb, which has no unsigned int type. I see three main possibilities for storing them in other field types, and converting on going in and out:

Using a signed int is probably easiest and most space efficient, but has the disadvantage that they're not human readable and if someone forgets to do the conversion

error: no matching function for call to ‘min(long unsigned int&, unsigned int&)’
by ShiggityShaw in Programming Languages

I'm using ubuntu 12.04 - 64 bits. I tested it with boost 1.46, 1.48, 1.52 and
gcc 4.4 and 4.6
When I try to compile:

while (m_burstReqBeatsRemain) {
if (m_burstReqAddress % m_dramRowSize == 0) {
adm_request &req = m_admRequestQueue.back();

Assign unsigned char to unsigned short with bit operators in ansi C
by Germany in Web Design

I know it is possible to assign an unsigned char to an unsigned short, but I would like to have more control how the bits are actually assigned to the unsigned short.

unsigned char UC_8;
unsigned short US_16;
UC_8 = 0xff;
US_16 = (unsigned char) UC_8;

The bits from UC_8 are now placed in the lower bits of US_16. I need more control of the conve

Initialization of std::vector<unsigned int> with a list of consecutive unsigned integers
by Poland in Web Design

I want to use a special method to initialize a std::vector<unsigned int> which is described in a C++ book I use as a reference (the German book 'Der C++ Programmer' by Ulrich Breymann, in case that matters). In that book is a section on sequence types of the STL, referring in particular to list, vector and deque. In this section he write

Compile NSLog with unsigned int and unsigned long on iOS and OSX without a warning
by dlouzan in Programming Languages

On iOS NSUInteger is a unsigned int, on OSX it is a unsigned long. How can I make a print statement like

NSLog(@"Array has %d elements.",[array count]);

compile on both platforms without a warning? I can of course use an #ifdef #else #endif construct but that will add 4 lines of code. I could also cast the

How to treat a struct with two unsigned shorts as if it were an unsigned int? (in C)
by Train in Programming Languages

I created a structure to represent a fixed-point positive number. I want the numbers in both sides of the decimal point to consist 2 bytes.

typedef struct Fixed_t {
unsigned short floor; //left side of the decimal point
unsigned short fraction; //right side of the decimal point
} Fixed;

Now I want to add two fixed point numbers, F

C - unsigned int to unsigned char array conversion
by asp.net in Web Design

I have an unsigned int number (2 byte) and I want to convert it to unsigned char type. From my search, I find that most people recommend to do the following:

unsigned int x;
unsigned char ch = (unsigned char)x;

Is the right approach? I ask because unsigned char is 1 byte and we casted from 2 byte data to 1 byte.

To prevent any dat

Delphi/C++ DLL problem - unsigned long vs unsigned int?
by Vietnam in Programming Languages

(SOLVED: See self-reply. Thanks to those that answered).

I'm having a weird problem with a C++ DLL I am loading dynamically into my Delphi 6 Pro program. One of the function calls in the DLL is:

__declspec(dllexport) int foo(unsigned int A, unsigned long bitsetVector);

I have the function pointer cast in my Delphi function as:

foo : function(A:

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .