go to start Ex W13
|home |print view |recent changes |changed December 12, 2017 |
|You are <- set your identity!

Sections: Introductory Questions | Array dimension deduction | Managing Objects on the Heap | Shared Pointer to =[this]= | Reverse Echo | Filename arguments | Topological Sort | NOTE |

Introductory Questions ^

Array dimension deduction ^

Which C++ mechanism can you use to deduce a dimension of an array passed as function parameter?

Managing Objects on the Heap ^

How do you create an instance of the default-constructible type Block on the heap?

How do you delete the instance created on the heap?

What problem arises if you have loops in your object structure and how do you solve this?

Shared Pointer to this ^

How can you access to a shared pointer from within the this object?

Reverse Echo ^

Write a C++ program echor that produces a list of its program arguments in reverse order without using a hand-written loop or recursion.

$ echor zero one two three

Filename arguments ^

Take some of your example programs (ExW9) that read all of standard input and process it to take an optional argument for your program giving it the filename to be processed. If no name is given your program should work with standard input as before. If more than one filename is given, your program should work on all files given.

For example:

$ wcount wcount.cpp word.h word.cpp
should read the three files and output the number of words in these three files combined.

Hint: If you execute such an application from within Cevelop, the working directory will be the project root. This can be relevant if you supply relative paths. If in doubt consult the "Run Configuration" where provide such command line arguments.

Topological Sort ^

Solve the exercise from the OO module in C++ using (smart) pointers to build the graph of objects.


1: Math OO
2: DB1 AD1 CPI
3: DB2 SE1 UI1
4: SE2 UI2
5: Thesis



see also skripte server: https://skripte.hsr.ch/Informatik/Fachbereich/Objektorientierte_Programmierung/OO/%c3%9cbungen/08_Collections_TESTAT2/

|home |print view |recent changes |changed December 12, 2017 |
|You are <- set your identity!

Ex W13
go to start