Originally posted by: Bacardi151
Originally posted by: notfred
Originally posted by: Bacardi151
good idea,
but does that mean i have to fill it up with 200K bytes? meaning i have to put it through a 200,000 loop? won't that be very inefficient?
How is allocating 100,000 characters going to be faster than allocation 200,000 bytes? I mean, either one will probably take a modern computer at least 0.1 seconds. We were discussing randomly generating arrays of characters with 3,000,000 million entries in software earlier - and doing it in as little as 0.8 seconds.
i initially actually made a string of 50 chars, which would in turn be 100bytes, meaning i only have to do a for loop of 2,000 loops.
doing a 200,000 loop will cost 100 times more of efficiency, won't it?
i never used the type bytes, i'm a java newb, can i just assign a number to a byte?
i.e. byte data = 5;
would that make the data variable of size 1byte? and is it initialized appropriately?