int

Parse CSV string into Array of Integers

I have a text box field inputs 123,145,125 I to separate this field into an array of integers. And validate this field true or false if everything is parsed right. CODE: private bool chkID(out int[] val) { char[] delimiters = new char[] { ',' }; string[] strSplit = iconeID.Text.Split(delimiters); int[] intArr = null;...

Client/Server: Integer always received as 1 (C-programming)

Hi! I'm building a client and a server program that exchanges data over TCP and I'm having trouble sending an ACK-confirmation from the server back to the client when an operation is successfull. I've managed to send a struct with various members from the client to the server, then the server should respond by sending an integer confirm...

Is a guid as identity field better in domain-driven design?

Is it easier to implement domain-driven design when using guids as identity fields instead of auto incrementing integers? With guids you don't have to jump to the database to get the actual value. ...

C unsigned int array and bit shifts

If i have an array of short unsigned ints. Would shifting array[k+1] left by 8 bits, put 8 bits into the lower half of array[k+1]? Or do they simply drop off as they have gone outside of the allocated space for the element? ...

Convert single char to int

How can I convert char a[0] into int b[0] where b is a empty dynamically allocated int array I have tried char a[] = "4x^0"; int *b; b = new int[10]; char temp = a[0]; int temp2 = temp - 0; b[0] = temp2; I want 4 but it gives me ascii value 52 Also doing a[0] = aoti(temp); gives me error: invalid conversion from ‘char’ to ‘cons...

C# int, Int32 and enum's

If int is synonymous to Int32 why does enum MyEnum : Int32 { Value = 1 } ...not compile? Where as enum MyEnum : int { Value = 1 } will, even though hovering the cursor over the int word will display struct System.Int32? ...

C Unsigned int providing a negative value?

I have an unsigned integer but when i print it out using %d there is sometimes a negative value there? ...

convert 01, 02, 03, 04 .. 09 to 1,2,3,4 ... 9

Hay how can I convert 01 to 1 02 to 2 all the way to 9? Thanks ...

How to reinitialize the int array in java

class PassingRefByVal { static void Change(int[] pArray) { pArray[0] = 888; // This change affects the original element. pArray = new int[5] {-3, -1, -2, -3, -4}; // This change is local. System.Console.WriteLine("Inside the method, the first element is: {0}", pArray[0]); } static void Main() ...

Pros/cons to using char for small integers in C

Is there any disadvantage to using char for small integers in C? Are there any advantages other than the occupancy/memory benefit? In particular, is the processor likely to cope with integer arithmetic on a char better or worse than it would on a (long/short) int? I know this will be processor/system/compiler specific, but I'm hoping f...

Multiplying two long long ints C

I am working on a program in C as a part of Homework in which I have to get the product of two long numbers which are taken as character string. eg: 123456789021 and 132456789098. Since it is taken as a string, I converted them to long long int for the multiplication. But the resulting product will be very large(larger than long long int...

PHP Twitter API Cursor?

Hi, If i use the "cursor"=>"-1" i get pagination, at which i can read the next_cursor. I get 1.312477885269E+18 when i read next_cursor. To call again, i set the cursor as the next_cursor which was returned back from the previous call, 1.312477885269E+18 - do i send it in this format, or somehow do i have to convert this into an int? ...

Sort NSArray's by an int contained in the array

I have an array, let's call it "array" and inside of the array I have objects like this: "0 Here is an object" "4 Here's another object" "2 Let's put 2 here too!" "1 What the heck, here's another!" "3 Let's put this one right here" I would like to sort the arrays by that number, so it'll turn into this: "0 Here is an object" "1 W...

cocoa: NSString not removing all the characters

I have an int and for some reason it isn't working after 16 or so. Here's my code: NSArray *sortedArray; sortedArray = [doesntContainAnother sortedArrayUsingFunction:firstNumSort context:NULL]; int count2 = [sortedArray count]; //NSLog(@"%d", count2); int z = 0; while (z < count2) { NSString *myString = [sortedArray objectAtIndex:z]...

C++ struct size: 2+4+2+2+4 = 16

Possible Duplicate: Why isnt sizeof for a struct equal to the sum of sizeof of each member? Why is the sizeof(); of this structure 16 bytes? I'm compiling in g++. struct bitmapfileheader { unsigned short bfType; unsigned int bfSize; unsigned short bfReserved1; unsigned short bfReserved2; unsigne...

What are differences between $id=(int)@$_REQUEST['id']; and $id=$_REQUEST['id'];

What do @ and (int) do in the following. $id=(int)@$_REQUEST['id']; ...

Int String format problem

Hi guys, I'm returning this, it is similar to how you percieve dollars, $"32.95" etc. I calculate it in cents which is an int, but the problem is the second half cuts off the 10s of cents part if the number is less than that. For example if I have "32.08" it returns as "32.8". Any ideas ? i know i need an if but i cant think how to write...

Which is better? To use short or int?

In Java or C++: Which is better? To use short or int for numbers that go to the short Max value, from 0 to 65535 in the case of unsigned short in C++. I heard something about using int is better by the processor registers... ...

int object is not iterable?

inp = int(input("Enter a number:")) for i in inp: n = n + i; print (n) ... throws an error: 'int' object is not iterable I wanted to find out the total by adding each digit, for eg, 110. 1 + 1 + 0 = 2. How do I do that? Thanks ...

reading int from console

How can I convert a String array into an int array in java? I am reading a stream of integer characters into a String array from the console, with BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); for(c=0;c<str.length;c++) str[c] = br.readLine(); where str[] is String typed. I want to compare the str[] ...