Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Simple Parser

Reply
Thread Tools

Re: Simple Parser

 
 
Bill Cunningham
Guest
Posts: n/a
 
      04-11-2004
> I recommend getc and putc, using real FILE* objects which you can
> test by setting them to stdin and stdout in main(). Example:
>
>
> int process_stream(FILE *in, FILE *out);
>
> int main()
> {
> process_stream(stdin, stdout);
> return 0;
> }
>

I tried this code with djgpp and it wouldn't compile. Does it compile
for you?

Bill


 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      04-11-2004
Bill Cunningham <(E-Mail Removed)> scribbled the following:
>> I recommend getc and putc, using real FILE* objects which you can
>> test by setting them to stdin and stdout in main(). Example:
>>
>> int process_stream(FILE *in, FILE *out);
>>
>> int main()
>> {
>> process_stream(stdin, stdout);
>> return 0;
>> }
>>

> I tried this code with djgpp and it wouldn't compile. Does it compile
> for you?


No, nor should it. The function process_stream is declared but never
defined. Obviously this was intended to be compiled along with another
file, which defines the function.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Show me a good mouser and I'll show you a cat with bad breath."
- Garfield
 
Reply With Quote
 
 
 
 
Arthur J. O'Dwyer
Guest
Posts: n/a
 
      04-11-2004

On Sun, 11 Apr 2004, Joona I Palaste wrote:
>
> Bill Cunningham <(E-Mail Removed)> scribbled the following:
> >> I recommend getc and putc, using real FILE* objects which you can
> >> test by setting them to stdin and stdout in main(). Example:
> >>
> >> int process_stream(FILE *in, FILE *out);
> >>
> >> int main()
> >> {
> >> process_stream(stdin, stdout);
> >> return 0;
> >> }
> >>

> > I tried this code with djgpp and it wouldn't compile. Does it compile
> > for you?

>
> No, nor should it. The function process_stream is declared but never
> defined. Obviously this was intended to be compiled along with another
> file, which defines the function.


And, of course, #including at least <stdio.h>, for the FILE stuff.
Bill knows this -- the giveaway is that he knows how to invoke DJGPP.
I doubt anyone who uses a compiler regularly is really ignorant of the
need to define functions that are supposed to get used.

-Arthur
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
import parser does not import parser.py in same dir on win Joel Hedlund Python 2 11-11-2006 03:46 PM
import parser does not import parser.py in same dir on win Joel Hedlund Python 0 11-11-2006 11:34 AM
XML Parser VS HTML Parser ZOCOR Java 11 10-05-2004 01:58 PM
XMLparser: Difference between parser.setErrorHandler() vs. parser.setContentHandler() Bernd Oninger Java 0 06-09-2004 01:26 AM
XMLparser: Difference between parser.setErrorHandler() vs. parser.setContentHandler() Bernd Oninger XML 0 06-09-2004 01:26 AM



Advertisments