Skip to content

BaseMax/cpp-ostream-istream-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

C++ ostream/istream Example

A small C++ program to exercise istream and ostream >>, << operator and overriding * operator to generate a Array list automatically.

Structure

  • Pill (name and price)
  • Sheet (A array of Pill)

Question

Write and complete following application without chaning main() function:

int main() {
	Pill P("Penicillin", 100);
	Sheet S;
	S = P *10;
	cout << S << endl;
}

Output

Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
Penicillin,100
total = 1000

About

A small C++ program to exercise istream and ostream >>, << operator and overriding * operator to generate a array list automatically.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages