🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sequent
2 messages
2 total messages Started by Luis Barriga Fri, 16 Feb 1990 18:03
Problem reading float with scanf
#904
Author: Luis Barriga
Date: Fri, 16 Feb 1990 18:03
28 lines
1442 bytes
Here is a problem discovered by a student.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#include <stdio.h>
 float h;
main()
{
  printf(" give step: ");
  scanf("%f",&h);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

It loggs you out while readind a number starting with zero and point, i.e
"0.". All other numbers like .73737 .6464 123.45 1.2233 5.666 etc. are
read OK. Has anybody had this problem? 

P.S. I've tested this same program on a VAX and SUN and I was logged
out as well while giving a number 0.

P.P.S. I wanted to post this letter to all other concerned groups as
well but I had already sent it );-)
--
________________________________________________________________________|
   Luis Barriga			     The Royal Institute of Technology	|
				     Dep. Computer systems (TDS)	|
   e-address: luis@tds.kth.se	     S-100 44 Stockholm			|
				       SWEDEN     			|
________________________________________________________________________|
Re: Problem reading float with scanf
#907
Author: John Blommers
Date: Mon, 19 Feb 1990 22:53
5 lines
676 bytes
This should not happen.

I tried it on an hp9000 model 835.
It parses, and a debug printf showed the scanf to work.
I don't see why you'd be logged of a system because of parsing problems.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads