SlideShare a Scribd company logo
M.SUJITHA,M.SC.,
N.S College, Theni.
C++ STREAM CLASSES
Ios:
It contains basic facilities that are used by all other
input and output classes.
Istream:
It inherites the properties of ios and it declares input
functions such as get(),getline() and read().
Ostream:
It inherites the properties of ios and it declares
output functions such as put() and write().
Iostream:
It inherites the properties of ios stream and ostream.
Streambuf:
It provides an interface to physical devices through
buffers.
The features that supports to format the console
I/O operations are:
◦ Ios class functions and flags
◦ Manipulators
◦ User-defined output functions
IOS CLASS FUNCTIONS AND FLAGS:
It consists of large number of member functions
that is used to format the output in number of ways.
 MANIPULATORS:
These are the special functions that are
included in the I/O statements to format the
parameters of a stream.
 DEFINING FIELD WIDTH:
◦ It is used to define the width of the field.
◦ Can be defined using width();
SETTING PRECISION:
It is used to specify the to be displayed after the
decimal point.
FILLING AND PADDING:
 It is used to print the values using the larger field
widths.
 It can be declared by,
cout.fill();
#include <iostream>
using namespace std;
int main()
{
int item[4] ={ 10,8,12,15};
int cost[4]={75,100,60,99};
cout.width(5);
cout<<”Items”;
cout.width(8);
cout<<”Cost”;
cout.width(15);
cout<<”Total Value”<<”n”;
int sum=0;
for(int i=0;i<4 ;i++)
{
cout.width(5);
cout<<items[i];
cout.width(8);
cout<<cost[i];
int value = items[i] * cost[i];
cout.width(15);
cout<<value<<”n”;
sum= sum + value;
}
cout<<”n Grand total = “;
cout.width(2);
cout<<sum<<”n”;
return 0;
}
OUTPUT:
ITEMS COST TOTAL VALUE
10 75 750
8 100 800
12 60 720
15 99 1485
Grand total =3755
It is used for defining the input and output in
various forms.
Overloaded Operators >> and <<:
• It is used to give the I/O
• The >> is overloaded in istream class
• The << is overloaded in ostream class
Ex:
cin>>item1>>item2;
put() and get() Functions:
◦ It is used for the input and output .
◦ Put(c) is used to give the input
◦ Get(c) is used to get the output
EXAMPLE:
#include <iostream>
using namespace std;
int main()
{
int count=0;
char c;
cout<<”INPUT TEXT n”;
cin.get( c );
while ( c 1=’n’ )
while ( c 1=’n’ )
{
cout.put( c);
count++;
cin.get( c );
}
cout<< “n Number of characters =” <<count <<”n”;
return 0;
}
OUTPUT:
Object oriented programming
Number of characters=27
Getline() and write() Functions:
• The getline() function reads a whole line of the
text and ends with a newline character.
• This function can be invoked by,
cin.getline (line,size);
• The writeline() function reads a whole line of the
text and displays an entire line.
• This function can be invoked by,
cout.write (line,size);
EXAMPLE:
#include <iostream>
using namespace std;
int main()
{
int size=20;
char city[20];
cout<<”enter city name:n “;
cin>>city;
cout<<”city name:”<<city<<”nn”;
cout<<”enter city name again: n”;
cin.getline(city,size);
cout<<”city name now:”<<city<<”nn”;
cout<<”enter another city name: n”;
cin.getline(city,size);
cout <<”New city name:”<<city<<”nn’;
return 0;
}
OUTPUT:
first run
Enter city name:
Delhi
Enter city name again:
City name now:
Enter another city name:
Chennai
New city name:
Chennai
 The header file iomanip provides a set of functions
called manipulators which can be used to manipulate
the output formats.
 They provide the same features as that of the ios
member function and flag.
 Two or more manipulators can be,
Cout<<manip1<<manip1<<manip<<item;
Cout<<manip1<<item1<<manip2<<item2;
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
cout.setf(ios::showpoint);
cout<<setw(5)<<”n”<<setw(15)<<”inverse of
n”<<setw(15)<<”sum of terms”;
double term,sum=0;
for (int n=1;n<=10;n++)
{
term=1.0/float(n);
sum=sum + term;
cout<<setw(5)<<n<<setw(14)<<setprecision(4)<<setiosflags(ios::ss
scientific)<<term<<setw(13)<<resetioflags(ios::scientific<<sum<
<endl;
}
return 0;
}
 The large amount of Data can be handled using some
devices such as floppy disk or hard disk to store those
datas.
 These datas are stored in these devices called FILES.
 The Programs can be designed to perform the read and
write operations on those files.
 Kinds of Data Communication:
◦ Data Transfer between the console unit and the
program.
◦ Data Transfer between the program and a Diskfile.
Managing,working with files
FILEBUF:
It is used to set the file buffers to read and write.
FSTREAMBASE:
It provides operations common to the file streams.
IFSTREAM:
It provides input operations.
OFSTREAM:
It provides output operations.
FSTREAM:
It provides support for both input and output
operations.
 The I/O system contains a set of classes that define
the file handling methods.
 These includes ifstream, ofstream and fstream.
 These classes are derived from fstreambase and from
the corresponding iostream class.
 These classes are designed to manage the Disk files,
which are declared in fstream and we should include
any program in these files.
 A file stream can be declared using the classes
ifstream, ofstream and fstream that are contained in
the Header file fstream.
 A file can be Opened into two ways:
Using the Constructor function of the class
Using the Member function open() of the class
OPENING FILES USING Open():
 The function open() can be used to open multiple
files that use the same stream object.
file-stream-class stream-object;
stream-object.open (“file name”);
#include<iostream.h>
#include<fstream.h>
int main()
{
ofstream fout;
fout.open(“Country names”);
fout<<“Uniited States Of American”;
fout<<“United Kingdomn”;
fout.close();
return 0;
}
OUTPUT:
Country names
United States Of America
United Kingdom
This condition is necessary for preventing data
from the file. This condition is
MORE ABOUT OPEN( ): FILE MODES
• The ifstream and ofstream is used to create
the new files.
• The function open( ) is used to open a new
stream.
object. open(“file name”,mode);
Each file has two associated pointers known
as File pointers.
DEFAULT ACTIONS:
When we open a file in read-only-mode
,these input pointer is automatically set at the
beginning.
FUNCTIONS FOR MANIPULATION OF FILE POINTERS:
 seekg()-Moves a pointer to specified location
 seekp()-Moves put pointer to a specified location
 tellg()-Gives the current position of the get pointer
 tellp()-Gives the current position of the put pointer
It supports a number of member function for
performing the input/output operations on files.
Put() and get() Functions:
◦ It is used to handle single character at a time.
◦ The function put() writes a single character to the
associated stream.
◦ The function get() reads a single character to the
associated stream.
Write() and read() Functions:
It is used to read and write the blocks in the binary
data.
 It is used to maintain the routine task in the data file.
 The updation can be done in:
◦ Displaying the contents of a file
◦ Modifying an existing item
◦ Adding a new file
◦ Deleting an existing file
 The reading and writing files may not be true
always.
◦ A file which we are attempting to open for reading
does not exist.
◦ The file name used for a new file may already exist.
◦ We may use an invalid file name.
◦ There may not be any space in the disk for storing
more data.
◦ We may attempt to perform an operation when the
file is not opened for that purpose.
 This feature facilities the supply of arguments to the
main() function.
 These arguments are supplied at the time of invoking
the program.
◦ C> exam data results
◦ Exam is the name of the file containing the program
to be executed ,data and results are the filenames
passed to the program as command-line arguments.
THANKYOU!!!

More Related Content

What's hot (20)

PPTX
Files in c++
NivethaJeyaraman
 
PPTX
Data file handling in python binary & csv files
keeeerty
 
PDF
08. handling file streams
Haresh Jaiswal
 
PPT
File handling in C++
Hitesh Kumar
 
PPT
Filehandlinging cp2
Tanmay Baranwal
 
PPTX
Pipes and filters
bhatvijetha
 
PDF
Filesinc 130512002619-phpapp01
Rex Joe
 
PPT
file handling, dynamic memory allocation
indra Kishor
 
PPTX
Functions in python
Santosh Verma
 
PPTX
basics of file handling
pinkpreet_kaur
 
PPTX
Format String
Wei-Bo Chen
 
PDF
Complete Guide for Linux shell programming
sudhir singh yadav
 
PPT
Data file handling
Saurabh Patel
 
PPT
Java File I/O
Canterbury HS
 
PPTX
Data file handling
TAlha MAlik
 
PDF
Input File dalam C++
Teguh Nugraha
 
PDF
Filehadnling
Khushal Mehta
 
PPT
Java Input Output and File Handling
Sunil OS
 
PDF
Python - Lecture 11
Ravi Kiran Khareedi
 
Files in c++
NivethaJeyaraman
 
Data file handling in python binary & csv files
keeeerty
 
08. handling file streams
Haresh Jaiswal
 
File handling in C++
Hitesh Kumar
 
Filehandlinging cp2
Tanmay Baranwal
 
Pipes and filters
bhatvijetha
 
Filesinc 130512002619-phpapp01
Rex Joe
 
file handling, dynamic memory allocation
indra Kishor
 
Functions in python
Santosh Verma
 
basics of file handling
pinkpreet_kaur
 
Format String
Wei-Bo Chen
 
Complete Guide for Linux shell programming
sudhir singh yadav
 
Data file handling
Saurabh Patel
 
Java File I/O
Canterbury HS
 
Data file handling
TAlha MAlik
 
Input File dalam C++
Teguh Nugraha
 
Filehadnling
Khushal Mehta
 
Java Input Output and File Handling
Sunil OS
 
Python - Lecture 11
Ravi Kiran Khareedi
 

Similar to Managing,working with files (20)

PPTX
Managing console of I/o operations & working with files
lalithambiga kamaraj
 
PPTX
programming language in c&c++
Haripritha
 
PPT
Input and output in C++
Nilesh Dalvi
 
PDF
C_and_C++_notes.pdf
Tigabu Yaya
 
PPT
cpp input & output system basics
gourav kottawar
 
PPTX
FILE OPERATIONS.pptx
DeepasCSE
 
PPTX
working with files
SangeethaSasi1
 
PPTX
Managing console input
rajshreemuthiah
 
PDF
Files and streams
Pranali Chaudhari
 
PDF
File Handling.pdffile handling ppt final
e13225064
 
DOCX
File handling in c++
Daniel Nyagechi
 
PPTX
13 file handling in C++.pptx oops object oriented programming
archana22486y
 
PDF
Managing I/O in c++
Pranali Chaudhari
 
PPTX
File Handling
TusharBatra27
 
DOCX
Console i/o for c++
Darshan Radadiya
 
PDF
streams and files
Mariam Butt
 
PPTX
Basics of file handling
pinkpreet_kaur
 
PPT
Lec 47.48 - stream-files
Princess Sam
 
PPT
Unit v
snehaarao19
 
PPT
PL-II Lecture19 oop in c++ pyaray bachon .ppt
inambscs4508
 
Managing console of I/o operations & working with files
lalithambiga kamaraj
 
programming language in c&c++
Haripritha
 
Input and output in C++
Nilesh Dalvi
 
C_and_C++_notes.pdf
Tigabu Yaya
 
cpp input & output system basics
gourav kottawar
 
FILE OPERATIONS.pptx
DeepasCSE
 
working with files
SangeethaSasi1
 
Managing console input
rajshreemuthiah
 
Files and streams
Pranali Chaudhari
 
File Handling.pdffile handling ppt final
e13225064
 
File handling in c++
Daniel Nyagechi
 
13 file handling in C++.pptx oops object oriented programming
archana22486y
 
Managing I/O in c++
Pranali Chaudhari
 
File Handling
TusharBatra27
 
Console i/o for c++
Darshan Radadiya
 
streams and files
Mariam Butt
 
Basics of file handling
pinkpreet_kaur
 
Lec 47.48 - stream-files
Princess Sam
 
Unit v
snehaarao19
 
PL-II Lecture19 oop in c++ pyaray bachon .ppt
inambscs4508
 
Ad

More from kirupasuchi1996 (15)

PPTX
Rotor machine,subsitution technique
kirupasuchi1996
 
DOCX
rotor machine
kirupasuchi1996
 
PPTX
DVI,FRACTAL IMAGE,SUB BAND IMAGE,VIDEO CODING AND WAVELET BASED COMPRESSION
kirupasuchi1996
 
PPTX
Cyper crime
kirupasuchi1996
 
PPTX
DS ppt
kirupasuchi1996
 
PPTX
Image compression standards
kirupasuchi1996
 
PPTX
Language and Processors for Requirements Specification
kirupasuchi1996
 
PPTX
Software Cost Factor
kirupasuchi1996
 
PPTX
GUI components in Java
kirupasuchi1996
 
PPTX
Designing Techniques in Software Engineering
kirupasuchi1996
 
PDF
Dmppt 180312092027
kirupasuchi1996
 
PDF
Datatransferandmanipulation 180214044522
kirupasuchi1996
 
PDF
Filesharing 180214044607
kirupasuchi1996
 
PDF
B tree-180214044656
kirupasuchi1996
 
PPTX
Addressingmodes
kirupasuchi1996
 
Rotor machine,subsitution technique
kirupasuchi1996
 
rotor machine
kirupasuchi1996
 
DVI,FRACTAL IMAGE,SUB BAND IMAGE,VIDEO CODING AND WAVELET BASED COMPRESSION
kirupasuchi1996
 
Cyper crime
kirupasuchi1996
 
Image compression standards
kirupasuchi1996
 
Language and Processors for Requirements Specification
kirupasuchi1996
 
Software Cost Factor
kirupasuchi1996
 
GUI components in Java
kirupasuchi1996
 
Designing Techniques in Software Engineering
kirupasuchi1996
 
Dmppt 180312092027
kirupasuchi1996
 
Datatransferandmanipulation 180214044522
kirupasuchi1996
 
Filesharing 180214044607
kirupasuchi1996
 
B tree-180214044656
kirupasuchi1996
 
Addressingmodes
kirupasuchi1996
 
Ad

Recently uploaded (20)

PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
July Patch Tuesday
Ivanti
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 

Managing,working with files

  • 3. Ios: It contains basic facilities that are used by all other input and output classes. Istream: It inherites the properties of ios and it declares input functions such as get(),getline() and read(). Ostream: It inherites the properties of ios and it declares output functions such as put() and write(). Iostream: It inherites the properties of ios stream and ostream. Streambuf: It provides an interface to physical devices through buffers.
  • 4. The features that supports to format the console I/O operations are: ◦ Ios class functions and flags ◦ Manipulators ◦ User-defined output functions IOS CLASS FUNCTIONS AND FLAGS: It consists of large number of member functions that is used to format the output in number of ways.
  • 5.  MANIPULATORS: These are the special functions that are included in the I/O statements to format the parameters of a stream.  DEFINING FIELD WIDTH: ◦ It is used to define the width of the field. ◦ Can be defined using width(); SETTING PRECISION: It is used to specify the to be displayed after the decimal point. FILLING AND PADDING:  It is used to print the values using the larger field widths.  It can be declared by, cout.fill();
  • 6. #include <iostream> using namespace std; int main() { int item[4] ={ 10,8,12,15}; int cost[4]={75,100,60,99}; cout.width(5); cout<<”Items”; cout.width(8); cout<<”Cost”;
  • 7. cout.width(15); cout<<”Total Value”<<”n”; int sum=0; for(int i=0;i<4 ;i++) { cout.width(5); cout<<items[i]; cout.width(8); cout<<cost[i]; int value = items[i] * cost[i]; cout.width(15);
  • 8. cout<<value<<”n”; sum= sum + value; } cout<<”n Grand total = “; cout.width(2); cout<<sum<<”n”; return 0; }
  • 9. OUTPUT: ITEMS COST TOTAL VALUE 10 75 750 8 100 800 12 60 720 15 99 1485 Grand total =3755
  • 10. It is used for defining the input and output in various forms. Overloaded Operators >> and <<: • It is used to give the I/O • The >> is overloaded in istream class • The << is overloaded in ostream class Ex: cin>>item1>>item2;
  • 11. put() and get() Functions: ◦ It is used for the input and output . ◦ Put(c) is used to give the input ◦ Get(c) is used to get the output EXAMPLE: #include <iostream> using namespace std; int main() { int count=0; char c; cout<<”INPUT TEXT n”; cin.get( c ); while ( c 1=’n’ )
  • 12. while ( c 1=’n’ ) { cout.put( c); count++; cin.get( c ); } cout<< “n Number of characters =” <<count <<”n”; return 0; } OUTPUT: Object oriented programming Number of characters=27
  • 13. Getline() and write() Functions: • The getline() function reads a whole line of the text and ends with a newline character. • This function can be invoked by, cin.getline (line,size); • The writeline() function reads a whole line of the text and displays an entire line. • This function can be invoked by, cout.write (line,size);
  • 14. EXAMPLE: #include <iostream> using namespace std; int main() { int size=20; char city[20]; cout<<”enter city name:n “; cin>>city; cout<<”city name:”<<city<<”nn”; cout<<”enter city name again: n”; cin.getline(city,size);
  • 15. cout<<”city name now:”<<city<<”nn”; cout<<”enter another city name: n”; cin.getline(city,size); cout <<”New city name:”<<city<<”nn’; return 0; }
  • 16. OUTPUT: first run Enter city name: Delhi Enter city name again: City name now: Enter another city name: Chennai New city name: Chennai
  • 17.  The header file iomanip provides a set of functions called manipulators which can be used to manipulate the output formats.  They provide the same features as that of the ios member function and flag.  Two or more manipulators can be, Cout<<manip1<<manip1<<manip<<item; Cout<<manip1<<item1<<manip2<<item2;
  • 18. #include<iostream> #include<iomanip> using namespace std; int main() { cout.setf(ios::showpoint); cout<<setw(5)<<”n”<<setw(15)<<”inverse of n”<<setw(15)<<”sum of terms”; double term,sum=0; for (int n=1;n<=10;n++)
  • 20.  The large amount of Data can be handled using some devices such as floppy disk or hard disk to store those datas.  These datas are stored in these devices called FILES.  The Programs can be designed to perform the read and write operations on those files.  Kinds of Data Communication: ◦ Data Transfer between the console unit and the program. ◦ Data Transfer between the program and a Diskfile.
  • 22. FILEBUF: It is used to set the file buffers to read and write. FSTREAMBASE: It provides operations common to the file streams. IFSTREAM: It provides input operations. OFSTREAM: It provides output operations. FSTREAM: It provides support for both input and output operations.
  • 23.  The I/O system contains a set of classes that define the file handling methods.  These includes ifstream, ofstream and fstream.  These classes are derived from fstreambase and from the corresponding iostream class.  These classes are designed to manage the Disk files, which are declared in fstream and we should include any program in these files.
  • 24.  A file stream can be declared using the classes ifstream, ofstream and fstream that are contained in the Header file fstream.  A file can be Opened into two ways: Using the Constructor function of the class Using the Member function open() of the class OPENING FILES USING Open():  The function open() can be used to open multiple files that use the same stream object. file-stream-class stream-object; stream-object.open (“file name”);
  • 25. #include<iostream.h> #include<fstream.h> int main() { ofstream fout; fout.open(“Country names”); fout<<“Uniited States Of American”; fout<<“United Kingdomn”; fout.close(); return 0;
  • 26. } OUTPUT: Country names United States Of America United Kingdom
  • 27. This condition is necessary for preventing data from the file. This condition is MORE ABOUT OPEN( ): FILE MODES • The ifstream and ofstream is used to create the new files. • The function open( ) is used to open a new stream. object. open(“file name”,mode);
  • 28. Each file has two associated pointers known as File pointers. DEFAULT ACTIONS: When we open a file in read-only-mode ,these input pointer is automatically set at the beginning. FUNCTIONS FOR MANIPULATION OF FILE POINTERS:  seekg()-Moves a pointer to specified location  seekp()-Moves put pointer to a specified location  tellg()-Gives the current position of the get pointer  tellp()-Gives the current position of the put pointer
  • 29. It supports a number of member function for performing the input/output operations on files. Put() and get() Functions: ◦ It is used to handle single character at a time. ◦ The function put() writes a single character to the associated stream. ◦ The function get() reads a single character to the associated stream. Write() and read() Functions: It is used to read and write the blocks in the binary data.
  • 30.  It is used to maintain the routine task in the data file.  The updation can be done in: ◦ Displaying the contents of a file ◦ Modifying an existing item ◦ Adding a new file ◦ Deleting an existing file
  • 31.  The reading and writing files may not be true always. ◦ A file which we are attempting to open for reading does not exist. ◦ The file name used for a new file may already exist. ◦ We may use an invalid file name. ◦ There may not be any space in the disk for storing more data. ◦ We may attempt to perform an operation when the file is not opened for that purpose.
  • 32.  This feature facilities the supply of arguments to the main() function.  These arguments are supplied at the time of invoking the program. ◦ C> exam data results ◦ Exam is the name of the file containing the program to be executed ,data and results are the filenames passed to the program as command-line arguments.