Some hint requests for read_line variations

E

emmba

The premise for my assignment is to write variations of the read_line
functions. The variations are:
a) skips leading whitespace before storing input
b) stops reading at first whitespace character
c) leaves behind characters that it does not have room to store

Could anyone give me a couple hints? I'm not really sure where to
start. Thanks!
 
W

Walter Roberson

The premise for my assignment is to write variations of the read_line
functions. The variations are:
a) skips leading whitespace before storing input
b) stops reading at first whitespace character
c) leaves behind characters that it does not have room to store
Could anyone give me a couple hints? I'm not really sure where to
start. Thanks!

getc()
isspace()
malloc()
 
C

CBFalconer

emmba said:
The premise for my assignment is to write variations of the read_line
functions. The variations are:
a) skips leading whitespace before storing input
b) stops reading at first whitespace character
c) leaves behind characters that it does not have room to store

Could anyone give me a couple hints? I'm not really sure where to
start. Thanks!

a) isspace();
b) !isspace();
c) ungetc();

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top