lukermsdn111
March 14th, 2010, 09:27 AM
String tempString = testData[5]; // testData[5] = 17896
char tempArray[] = tempString.toCharArray();
int groupAddress = tempArray[0] + tempArray[1] + tempArray[2] + tempArray[3];
int cacheIndex = tempArray[3];
int byteOffset = tempArray[4];
int cacheTag = tempArray[0] + tempArray[1] + tempArray[2];
System.out.println(groupAddress); // Prints 217
System.out.println(cacheIndex); // Prints 57
System.out.println(byteOffset); // Prints 54
System.out.println(cacheTag); // Prints 160
Here the Program (I think) is printing out ASCII characters for the numbers rather than the numbers themselves. How would i make the program print out the numbers and not the ASCII characters?
Luke
char tempArray[] = tempString.toCharArray();
int groupAddress = tempArray[0] + tempArray[1] + tempArray[2] + tempArray[3];
int cacheIndex = tempArray[3];
int byteOffset = tempArray[4];
int cacheTag = tempArray[0] + tempArray[1] + tempArray[2];
System.out.println(groupAddress); // Prints 217
System.out.println(cacheIndex); // Prints 57
System.out.println(byteOffset); // Prints 54
System.out.println(cacheTag); // Prints 160
Here the Program (I think) is printing out ASCII characters for the numbers rather than the numbers themselves. How would i make the program print out the numbers and not the ASCII characters?
Luke