Changeset 65b851a for doc


Ignore:
Timestamp:
Jan 28, 2024, 4:00:31 PM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
2989d6f, 7329b0a
Parents:
b771581
Message:

start updaing documentation for input changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/user/user.tex

    rb771581 r65b851a  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Mon Jan 22 11:59:04 2024
    14 %% Update Count     : 5961
     13%% Last Modified On : Sun Jan 28 13:28:23 2024
     14%% Update Count     : 5979
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    45994599For example, in:
    46004600\begin{cfa}
     4601int i, j;
    46014602sin | i | ®nl® | j;
    460246031 ®2®
     
    46044605\end{cfa}
    46054606variable ©i© is assigned 1, the 2 is skipped, and variable ©j© is assigned 3.
     4607For example, in:
     4608\begin{cquote}
     4609\begin{tabular}{@{}l@{\hspace{3em}}l@{}}
     4610\begin{cfa}
     4611char ch
     4612
     4613sin | ch; // read X
     4614
     4615X
     4616\end{cfa}
     4617&
     4618\begin{cfa}
     4619
     4620sin | ®nlOn®; // enable reading newlines
     4621sin | ch; // read newline
     4622
     4623
     4624\end{cfa}
     4625\end{tabular}
     4626\end{cquote}
     4627the left example skips the newline and reads ©'X'© into ©ch©, while the right example reads the newline into ©ch©.
    46064628
    46074629For output:
     
    49424964
    49434965\item
    4944 \Indexc{wdi}( maximum, reference-value )\index{manipulator!wdi@©wdi©}
    4945 For all types except ©char©, maximum is the maximum number of characters read for the current operation.
     4966\Indexc{wdi}( maximum, reference )\index{manipulator!wdi@©wdi©}
     4967For all types except ©char *©, maximum is the maximum number of characters read for the current operation.
    49464968\begin{cfa}[belowskip=0pt]
    4947 char s[10];   int i;   double d;   
    4948 sin | wdi( 4, s ) | wdi( 3, i ) | wdi( 8, d );  // c == "abcd", i == 123, d == 3.456E+2
     4969char ch;   char ca[3];   int i;   double d;   
     4970sin | wdi( sizeof(ch), ch ) | wdi( sizeof(ca), ca[0] ) | wdi( 3, i ) | wdi( 8, d );  // c == 'a', ca = "bcd", i == 123, d == 345.6
    49494971\end{cfa}
    49504972\begin{cfa}[showspaces=true,aboveskip=0pt,belowskip=0pt]
    49514973®abcd1233.456E+2®
    49524974\end{cfa}
     4975Here, ©ca[0]© is type ©char©, so the width reads 3 characters \Textbf{without} a null terminator.
     4976
    49534977Note, input ©wdi© cannot be overloaded with output ©wd© because both have the same parameters but return different types.
    49544978Currently, \CFA cannot distinguish between these two manipulators in the middle of an ©sout©/©sin© expression based on return type.
Note: See TracChangeset for help on using the changeset viewer.