int array with string.Split?

2012-12-18  Source: Original Site  Category:C++  Views:0 

Advertisement

I've got a MAC address in a string format, and I need to hack it up into an int array.

int [] iMacArray = null;
string delimstr = ".";
char [] delimiter = delimstr.ToCharArray();
int num = 17;

iMacArray = strMAC.Split(delimiter,num));

How can I get that string hacked up properly?

Related articles
  • int array with string.Split? 2012-12-18

    I've got a MAC address in a string format, and I need to hack it up into an int array. int [] iMacArray = null; string delimstr = "."; char [] delimiter = delimstr.ToCharArray(); int num = 17; iMacArray = strMAC.Split(delimiter,num)); How can I get t

  • Splitting individual characters with String.split() 2014-12-23

    I can't seem to split indivudual characters with String.split() Example: auty dndp oepd qnmb This is the .txt file that is being input. I need to split this file and put it in an array. [a,u,t,y,d,n,d,p,o,e,p,d,q,n,m,b] All I can get it to do right n

  • Problem with int array to string convert function 2012-11-21

    During a university project, I had to print some int arrays to the screen, and I wanted to do it with printf. So I decided to include a function that converts an integer array into a string type, and passes the string out to the calling function. But

  • 2d array with strings 2014-09-10

    Well, that pretty much explains it. Im trying to make a program that will draw a box like this: +-------+ | | +-------+ But it needs to be an array, with each character in its own array. #include <iostream> #include <string> using namespa

  • Ubuntu C++: Looking for most efficient way to translate int array to String 2015-04-13

    I am writing code to translate an integer vector (not vector<int>, but a slightly different "proprietary" datatype -- I am programming a tester and the tester API for some reason thought it was necessary to invent a new datatype for a vector, b

  • from int array to string 2014-05-04

    I was wondering if this is even possible? I currently have a result which is in a pointer int array for example number temp; // struct format which includes int * digit temp.digit[i]; // is where my digits are kept at. now I want to have a copy of th

  • Sorting int array with stack class 2014-11-14

    I am trying to figure out how to sort an array with a stack class. The array (pointer) and its length should be passed to the function as parameters so that the original will be sorted. The array created in main() should contain a maximum of 20 integ

  • problem with String.split() function 2012-05-25

    I have one problem with split() function of java.lang.String. class TestSplit { public static void main(String[] args) { String[] str="Kuldeep|Tewari".split("|"); System.out.println(str[0]+", "+str[1]); } } when i am using pipe(" | ") as a separtor b

  • Return Int Array as String 2012-12-20

    guys, I have written the following code which iterates over a integer array and returns a string by concatening the digits. Is there is an easier or more efficient way of writing this in Java similar to the C# function ToString? private int[] myArray

  • Cannot sort array with strings as keys 2013-01-20

    all! I'm new to this forum and registered because I need help with a small script. I'll probably post more here later - so here's my question: I have an array where the keys are strings and not integers. It looks like this: var test = new Array(); te

  • comparing Arrays with string 2014-02-02

    i have to arrays output of these array is: $upper_array Array ( [0] => A [1] => B [2] => C [3] => D [4] => E [5] => F [6] => G [7] => H [8] => I [9] => J [10] => K [11] => L [12] => M [13] => N [14] => O [

  • replace int? with string writing to file 2013-09-17

    Greetings I'm running in circes trying to accomplish something very simple. I have a csv file with multiple lines resembling: 0002345, 24, 5, 0.24 I need this format in my output file: '0002345', 24, 5 0.24 The first entry is a census meshblock code

  • How to "reset/unset" array with string keys 2013-12-19

    everyone, and thank you to all who have helped me get this far! :) Short version of my problem: How do I clear an array that uses string keys, or a combo of string and numeric keys without having to list each array element individually? Long version

  • Array with string index 2013-09-26

    I am wondering if it is possible to do something like: string names["first"] = "first name";

  • Calling MultiDim Arrays with strings 2015-04-22

    Here is an example of what I am trying to do: $array[key1][key2] = 'something'; $key = [key1][key2]; print $array{$key}; I was hoping that "something" would be printed, but its NOT working. Is it possible to do this? email: [email protected]

  • Length of an int array 2012-12-28

    How do you find the length of an int array?? I have int array with some values and I need to count how many values are there? I tried a lot of things like strlen(); sizeof(); etc.. int main(){ int iarray[10000]; // Now I have a lot of code here. cout

  • VB array of strings 2012-09-18

    I have a problem. I have created a DLL. My DLL imports a VB array with strings. Now, I would like to read the strings in the dll. I don't know a way to get this strings of the Visual Basic array that is passed in the DLL.

  • sorting arrays of strings....HELP!!! 2014-09-05

    I'm sooooo lost on how to sort arrays with strings, what am i suppossed to be comparing? Can I use the > operand? ex: if array[1] < array[2] { array [1] = temp array [2] = array[1] temp = array[2] } // array[1] = Boston // array[2] = Albany soo

  • String splitting to array... 2012-05-15

    I'm trying to split an input string into an array of substrings and currently trying something like this... public static void tryp(String inputString){ int index = 0; String[] rArray = new String[1000];String[] kArray = new String[1000]; int startPo

  • c string to int array 2012-09-07

    Ok so im trying to make a consturctor that 1. takes a string of numbers 2. turns each number into an int ( dont worry about bad data) 3. puts each integerinto an integer array I have the function that turns an Char 2 Integer right here --------------