This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
can some one tell me what is the syntx of scanf? i use jdk1.2 in dos format and i need to know what is scanf syntx in java.
------------------
Peter Tran
Bartender
Joined: Jan 02, 2001
Posts: 783
posted
0
Guy, There is no scanf in JAVA. scanf is a C library function. If you're looking for equivalant functionality, then I would recommend looking at the JAVA I/O classes. -Peter
Brett Knapik
Ranch Hand
Joined: Oct 15, 2000
Posts: 255
posted
0
That was the nice thing about c/c++ having easy ways to get i/o unlike java. ------------------ I wish there was a button on my monitor to turn up the intellegince. Theres a button called 'brightness' but it doesn't work
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
Java does provide plenty of tools to parse input streams, and none of them are as bug-inducing as scanf. On most C and C++ projects I've worked on we've had a "no scanf" rule, as it is just so hard to get right and so easy to crash the system with accidentally wrong input data. Is there some sort of input parsing you actually need to do? I'm sure there are plenty of people here who could help.
I have a free and fully functional Java printf/scanf at: http://www.braju.com/beta/ It is a beta since it requires more testing before I can upgrade it to a full version. However, no bugs have been found. The very stable Java printf only package is at http://www.braju.com/ and that has been up and running since 1997. Cheers, Henrik Bengtsson M.Sc. Computer Science Ph.D. student in Statistics Lund University, Sweden h e n r i k b @ b r a j u . c o m
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
posted
0
henrik Thanks for your input, hopefully some of our visitors can make use of your product. However, your name is not in keeping with the naming policy here at the ranch. Please re-register under an appropriate name as shown in the policy. Thanks again and we hope to see you around the ranch!!
------------------ Dave Sun Certified Programmer for the Java� 2 Platform
Dave
Henrik Bengtsson
Greenhorn
Joined: Oct 30, 2001
Posts: 2
posted
0
Sorry about that! "henrik"
Henrik Bengtsson<P>M.Sc. Computer Science<BR>Ph.D. student in Statistics<BR>Lund University, Sweden<BR>h e n r i k b @ b r a j u . c o m
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
posted
0
Thanks Henrik Hope you enjoy your time here at the ranch!!
------------------ Dave Sun Certified Programmer for the Java� 2 Platform
Dustin Sallings
Greenhorn
Joined: Sep 17, 2003
Posts: 1
posted
0
This is a very old thread, but it comes up pretty early for anyone looking for scanf type functionality for java. I think MessageFormat is an appropriate way to handle this type of thing The Java Way(tm) (seen here in jython): >>> import java >>> mf=java.text.MessageFormat("{0} days {1}:{2}:{3}") >>> os=mf.parse("1 days 4:20:02") >>> os array(['1', '4', '20', '02'], java.lang.Object)