🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #2806

Lattice C v5.04 sscanf question.

#2806
From: Robin D. Wilson/1000000
Date: Wed, 17 Jan 1990 21:25
32 lines
1722 bytes
I have a question about the sscanf function in Lattice C v5.04:

Given the following line of code:

	sscanf(buf, "%s %s %d%[^\n]", str1, str2, &(int), rest_of_buf_line)

Where buf is preset to something like:

	buf = "abc def 1/3 :rest of line"


My assumption was to use the "%[^\n]" as a "read to the newline character", 
which is how it works on my UNIX box at work.

Why doesn't the sscanf routine put "/3 :rest of line" in the string variable
"rest_of_buf_line"?

This works correctly on my UNIX machine, with a relatively standard C 
compiler.

BTW, I am not terribly knowledgable in "C", so take it easy on me.



+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|USNail:                               UUCP:                                  |
|2323 Wells Branch Pkwy., #G107        cs.utexas.edu!romp!ibmchs!auschs\      |
|Austin, TX  78728                     !sabre.austin.ibm.com!robin            |
|Home: (512)251-6889                          ^^^^^^^^^^^^^^<-MUST BE INCLUDED|
+-----------------------------------------------------------------------------+
Technical Details
Message-ID: <2966@d75.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!romp!auschs!d75!sabre!robin

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!romp!auschs!d75!sabre!robin
From: robin@sabre.uucp (Robin D. Wilson/1000000)
Newsgroups: comp.sys.amiga.tech
Subject: Lattice C v5.04 sscanf question.
Message-ID: <2966@d75.UUCP>
Date: 17 Jan 90 21:25:08 GMT
Sender: news@d75.UUCP
Reply-To: robin@reed.UUCP (Robin D. Wilson/1000000)
Distribution: comp.sys.amiga.tech
Organization: IBM AWD, Austin, TX
Lines: 32