View Single Post
  #1 (permalink)  
Old 08-07-2007, 08:42 PM
elizabeth elizabeth is offline
Member
 
Join Date: Jul 2007
Posts: 40
elizabeth is on a distinguished road
help with basic java code
Can I this function better?
Code:
//Calculate Csum A = A XOR B byte CountCsum(String m) { byte[] inData = m.getBytes(); byte csum=0; // Don't Count the first byte for(byte n=1;n<m.length();n++) csum ^= inData[n]; return csum; }
In C you normally sending a pointer to an array into the function but here I must convert the string to byte array
an that takes time and memory.

Are java sending a reference to the string or the entire string to the function??
Reply With Quote
Sponsored Links