Programming Question

wbarnhill said:
Oh yeah, the 20MB hard drives that were the size of two 5.25" bays. :D

Obviously you never saw an 8" drive.

The company I was working for at the time had a machine with 8" drive....
 
Wow! Is this thread still alive?
OK, FORTRAN, COBOL, FORTH, CP/M, JCL, Assembler (6502, 6809, 8086), Lisp, Pascal, BASIC (before it had an else statement), 8-inch floppies, tape drives (primary, not backup), keypunch, Hollerith cards, 4K of total memory, 300 baud audible modems and other stuff that is submersed in the Alzheimer's pool. Currently C/C++, Java, Javascript, XML, CSS, XSLT and specialty languages you haven't heard of. Have not yet taken up .NET.
 
SkyHog said:
I am having a bear of a time with what should be a really simple thing, and was wondering if any programmers could give advice on this.

In Java, I am trying to take a number, lets say 145, and add the individual digits together. I am taking the stupid backwards way in coverting to a string and trying to pull the chars out of it to do it, but I cannot find a way to convert a char to an int. I could convert the char to a string and then to an int, but that is even more backwards. Is there a way to pull a digit from a int like there is a way to pull a char from a string?

I haven't had the time to do anything with Java .. it's on my list though.

Can't you just move it into an array of 1 char elements and then add
together the elements?

There's a reason I stay with ILE RPG on our iSeries. This other stuff
takes way too much code to do simple things.

RT
 
RogerT said:
I haven't had the time to do anything with Java .. it's on my list though.

Can't you just move it into an array of 1 char elements and then add
together the elements?

There's a reason I stay with ILE RPG on our iSeries. This other stuff
takes way too much code to do simple things.

RT
Doing that means converting int to char back to int (unless you want to add up the char values of the integers), which is extremely inefficient in any language compared to keeping the variables in one data format and performing a division calculation (which is all a mod is).
 
Back
Top