Rockwell-automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User M Instrukcja Użytkownika Strona 60

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 312
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 59
Chapter 4
!"  $ "
4-8
/*
* Now, as long as we have files on the command line to process,
* open them, read them, and output them to standard output.
*/
for ( i = 1; i < argc; i++ )
{
/*
* Remember, fopen() returns a file pointer. If the file
* pointer returned points to NULL, the file couldn’t be
* opened. Exit and tell the user why.
*/
infil = fopen ( argv[i], “r” );
if ( infil == NULL )
{
fprintf ( stderr,
“*** cat: unable to open %s. Aborting\n”,
argv[i] );
exit ( errno );
}
/*
* Now loop to get all the characters in the input file and
* put them on the output file [“stdout” for “putchar()”].
*/
while ( ( c = getc ( infil ) ) != EOF )
putchar ( c );
/*
* Done with this file. Close it and get the next one...
*/
fclose ( infil );
}
/*
* Done with all the command line arguments, so done with this
* program!
*/
exit ( 0 );
}
When you are familiar with the programming environment, proceed to any
of the chapters listed below.
If you want to: Go to:
  " #! " "    "     '  #"!
'#   "! #"! " '#      ! 
#" %"     " 
" 
!"! " " #" ! &!  #! " " "
"   '     !
" 
!"! !   " #" " 
What to Do Next
Przeglądanie stron 59
1 2 ... 55 56 57 58 59 60 61 62 63 64 65 ... 311 312

Komentarze do niniejszej Instrukcji

Brak uwag