Skip to content

Free-format input conversion to one integer per call. Section 5.2 of The C Programming Language.

Notifications You must be signed in to change notification settings

JalalSayed1/getint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getint

free-format input conversion to one integer per call. Section 5.2 of The C Programming Language.

About the project:

  • getint performs free-format input conversion by breaking a stream of characters into integer values, one integer per call.
  • Returns the value it found and also signal end of file when there is no more input.
  • These values have to be passed back by separate paths, for no matter what value is used for EOF, that could also be the value of an input integer.
  • In this example, getint return the end of file status as its function value, while using a pointer argument to store the converted integer back in the calling function.

getint results:

  • getint can be run with the following ways to enter inputs:

    • Sequentially:
      image
    • OR one a time:
      image
  • Last thing the function prints is the array of size SIZE (SIZE = 10 in this example)

What did I learn from this:

  • Input streams in C.
  • Arrays, pointers and indexing.

About

Free-format input conversion to one integer per call. Section 5.2 of The C Programming Language.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages