🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2432

Re: fscanf problem

#2432
From: sg7248613
Date: Fri, 29 Mar 1996 12:08
60 lines
2492 bytes
In article <4ja3tv$pdl@solutions.solon.com>, tanmoy@qcd.Lanl.GOV (Tanmoy Bhattacharya) writes:
> In article <4imaao$dsi@solutions.solon.com>
> sg7248613@omega.ntu.ac.sg writes:
> 
> s: I have been trying to read a section of data from a file for days.
> s:     .....
> s:     Patch norm0 4 { { 0 -1 0 } { 0 -1 0 } { 0 -1 0 } { 0 -1 0 } }
> s:     Patch vert0 4 { { 0 1 0 } { 1 1 0 } { 1 1 1 } { 0 1 1 } }.

***** edited and deleted *****	

> s: The read of the first line is OK. But I can't scanf the second line
> s: successfully. Could anyone please enlighten me on this? Thank you!
> 
> Please post short complete compilable examples when asking
> questions. It is not clear to me what you mean by `I can't scanf the
> second line successfully'. What happens? Does the program crash? Does
> it print a message saying `I can't scanf the second line
> successfully'? 
> 
> Which second line? The format would read two lines of the form that
> you gave in one scanf. 
> 
> (I would have ignored such a vaguely worded post, but the other
> followups I see are incorrect, so I had to respond.)
> 
> Cheers
> Tanmoy

I am sorry that I have not made myself absolutely clear.

What I meant was that the first line of data which goes like

	Patch norm0 4 { { 0 -1 0 } ....

was successfully scanfed into a data structure and printed.

The second line

	Patch vert0 4 { { 0 1 0 } ....

encountered problems like segmentation faults or bus errors.

I have tried many variations of the code segments before seeking
help on this newsgroup. The code segment I posted was a generic
example of what I attempted myself.

I would like to take this opportunity to thank all the people who
have responded to my post, either by email or followup.

You have truly made a difference in the progress of my project.
I have since moved on to code other portions of my system, after
resolving this file-reading portion.

Thank you all again!


Tang Li Chow
Nanyang Technological University
Singapore
Technical Details
Message-ID: <4jgjs2$sao@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4imaao$dsi@solutions.solon.com> <4ja3tv$pdl@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: sg7248613@gamma.ntu.ac.sg
Newsgroups: comp.lang.c.moderated
Subject: Re: fscanf problem
Date: 29 Mar 1996 06:08:34 -0600
Organization: Nanyang Technological University - Singapore
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4jgjs2$sao@solutions.solon.com>
References: <4imaao$dsi@solutions.solon.com> <4ja3tv$pdl@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com