Teorija CPP: cestnoprometni predpisi: C, E, D – kat.: (za interno uporabo). Front Cover. Bojan Krajnc. B. Krajnc, – 89 pages. Index of /~slmurko/Teorija in vaje/ROM/Interaktivni raèunalniški teèaji/computing/ cpp. [ICO], Name · Last modified · Size · Description. [DIR], Parent Directory, -. Parent Directory, -. [TXT], BARCHART.C, Feb , K. [TXT], , Feb , K. [ ], , Feb , K.
|Published (Last):||6 March 2010|
|PDF File Size:||19.82 Mb|
|ePub File Size:||4.99 Mb|
|Price:||Free* [*Free Regsitration Required]|
In object-orientation, structure is organized by the data.
In our list example we have to use the special type ANY to allow the list to carry any data we like. For that reason, modular programming allows grouping of procedures into modules. Objects of the program interact by sending messages to each other. Since this example is just used to illustrate these concepts and problems it is clp complete nor optimal.
Instead teoeija calling a procedure which we must provide with the correct list handle, we would directly send a message to the list object in question. Consider the following example which the compiler cannot check for correctness:.
Index of /~murkos/Teorija in vaje/LAV/Software_145/KRMILJA/TC/BIN
Decoupling of data and operations leads usually to a structure based on the operations rather than the data: This handle is used in every provided procedure to uniquely identify the list in teorrija. Thus, the flow of data can be illustrated as a hierarchical graph, a treeas shown in Fig.
The problem here with modular programming is, that you must explicitly create and destroy your list handles. The following two procedures implement the mentioned access methods append and delete.
With procedural programming you are able to combine returning sequences of statements into one single place. The main program coordinates calls to procedures in separate modules and hands over appropriate data as parameters.
This is a fundamental principle in software engineering, so let’s repeat it: One could say that the defined operations specify the data to be used. For example, if a procedure is correct, every time it is used it produces correct results. Then you use the procedures of the module to modify each of your handles. Now we have a single program which is divided into small pieces called procedures.
Therefore we would like to be able to define a list similar to the definition of an integer.
Teorija CPP: cestnoprometni predpisi : (za interno uporabo) – Bojan Krajnc – Google Books
You were right, if this would be all about object-orientation. If you want to use a list within a procedure, say, foo you use the following code frame:.
This allows each module to manage an internal state which is modified by calls to procedures of this module. However, this implies more overhead and does not prevent you from knowing what you are doing. A code frame for this would look like this:. Programs use data structures to store data.
Each such object can be uniquely identified by its handle and only those methods are applicable which are teogija to operate on this handle. Each object is responsible to initialize and destroy itself correctly. Your interface definition file of your new list module looks like this:.
Consequently, you have to use a special type ANY which allows to assign data of any type to it. Every other procedure now contains the special parameter this which just cpp the list in question.
What we would like to have is a mechanism which allows us to specify on which data type the list should be defined. However, more complex data structures such as trees can be traversed using different strategies.
All procedures now operate on this handle rather than a module global list. Beginning with the next chapters additional features of object-orientation are introduced which makes object-oriented programming to a new programming technique. Starting with the leftmost element one successively visits the tdorija neighbours until one reaches the last element.