Skip to main content
Engineering LibreTexts

20: File I/O and Array Functions

  • Page ID
    10372
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    • 20.1: File Input and Output
      A file consisting of characters from the ASCII character code set. Text files (also know an ASCII text files) contain character data. When we create a text file we usually think of it consisting of a series of lines. On each line are several characters (including spaces, punctuation, etc.) and we generally end the line with a return (this a character within the ASCII character code set).
    • 20.2: Arrays and Functions
      Arrays are an important complex data type used in almost all programming. We continue to concentrate on simple one dimension arrays also called a list. Most programmers develop a series of user defined specific task functions that can be used with an array for normal processing.
    • 20.3: Loading an Array from a File
      Loading an array from a file presents an interesting dilemma. The problem resolves around how many elements you should plan for in the array. Let’s say 100, but what if the file has fewer or more than 100 values. How can the program handle it correctly?
    • 20.4: Math Statistics with Arrays
      Arrays are an important complex data type used in almost all programming. We continue to concentrate on simple one dimension arrays also called a list. Most programmers develop a series of user defined specific task functions that can be used with an array for normal processing.
    • 20.5: Practice 19 File I/O and Array Functions


    This page titled 20: File I/O and Array Functions is shared under a CC BY license and was authored, remixed, and/or curated by Kenneth Leroy Busbee (OpenStax CNX) .

    • Was this article helpful?