Laslo Kraus |
Rešeni zadaci iz programskog jezika C++ Ispravke uz prvo izdanje |
|---|
| Mesto | Pogrešno | Ispravno | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| strana: 38 red: ↓10 |
|
| |||||||||||||||||||||||||||
| strana: 45 red: ↑20 | return new Cvor (stb->broj, kopiraj(stb->levo), kopiraj(stb->desno));
| return stb ? new Cvor (stb->broj, kopiraj(stb->levo), kopiraj(stb->desno)) : 0;
| |||||||||||||||||||||||||||
| strana: 51 red: ↓21 | return min (stb);
| return max (stb);
| |||||||||||||||||||||||||||
| strana: 58 |
|
| |||||||||||||||||||||||||||
| strana: 72 red: ↓23 |
Red& Red::operator+= (const Red& r) {
Red s (r);
(posl ? posl->sled : prvi) = s.prvi;
posl = s.posl; duz += s.duz;
s.prvi = s.posl = 0;
s.duz = 0;
return *this;
}
|
Red& Red::operator+= (const Red& r) {
if (r.prvi) {
Red s (r);
(posl ? posl->sled : prvi) = s.prvi;
posl = s.posl; duz += s.duz;
s.prvi = s.posl = 0;
s.duz = 0;
}
return *this;
}
| |||||||||||||||||||||||||||
| strana: 89 red: ↓27 |
for (int i=0; i |
for (int i=0; i | |||||||||||||||||||||||||||
| strana: 93 |
|
| |||||||||||||||||||||||||||
| strana: 94 red: ↑16 |
public: ULista& operator+= (int b); |
public:
ULista () {}
ULista (int b): NLista (b) {}
ULista& operator+= (int b);
| |||||||||||||||||||||||||||
| strana: 101 |
|
| |||||||||||||||||||||||||||
| strana: 106 red: ↓17 |
Linija* kopija () const |
Duz* kopija () const | |||||||||||||||||||||||||||
| strana: 108 red: ↓19 |
case 'i': case 'I': {
case 'p': case 'P':
|
case 'i': case 'I':
case 'p': case 'P': {
| |||||||||||||||||||||||||||
| strana: 115 |
|
| |||||||||||||||||||||||||||
| strana: 115 |
|
| |||||||||||||||||||||||||||
| strana: 115 |
|
| |||||||||||||||||||||||||||
| strana: 117 red: ↓9 |
public:
class Elem {
…
~Elem () { &hellip }
friend class Prom;
};
|
public:
struct Elem {
…
~Elem () { &hellip }
};
| |||||||||||||||||||||||||||
| strana: 122 |
|
| |||||||||||||||||||||||||||
| strana: 124 red: ↓5 |
void operator! () const { +*izr; }
|
void operator! () const { if (izr) +*izr; }
| |||||||||||||||||||||||||||
| strana: 127 red: ↓23 |
prog += cikl;
while (1) {
|
prog += cikl;
cout << "Program:\n" << prog << endl;
while (true) {
| |||||||||||||||||||||||||||
| strana: 137 red: ↑11 |
return r + *this; return r - *this; return r * *this; return r / *this; |
return r + *this; return -r + *this; return r * *this; return !r * *this; | |||||||||||||||||||||||||||
| strana: 138 red: ↑8 | 1. Početna | 1. Početna matrica: | |||||||||||||||||||||||||||
| strana: 142 | | strana: 143 | red: ↑8
| public:
|
public:
virtual ~Fun() {} // Virtuelan destruktor.
strana: 147 | red: ↑5
| return cout << …
| return d << … strana: 149 | red: ↓3
|
Niz::Niz (double kk) {
|
Niz::Niz (int kk) {
strana: 167 | red: ↓4
|
{ return r * r * 3.14159; }
|
{ return 4 * r * r * r * 3.14159 / 3; }
strana: 169 | red: ↓16
|
GNemaMasinu (const char* iime, int iid) {
ime = new char [strlen(iime)+1];
strcpy (ime, iime);
id = iid;
}
friend ostream& operator<< …
|
GNemaMasinu (const char* iime, int iid) {
ime = new char [strlen(iime)+1];
strcpy (ime, iime);
id = iid;
}
GNemaMasinu (const GNemaMasinu& g) {
ime = new char [strlen(g.ime)+1];
strcpy (ime, g.ime);
id = g.id;
}
~GNemaMasinu () { delete [] ime; }
friend ostream& operator<< …
strana: 169 | red: ↑20
| const char* uzmiIme () …
|
~Radnik () // Uništavanje
{ delete [] ime; } // (radnik nije vlasnik mašine!)
const char* uzmiIme () …
strana: 173 | red: ↑8
| ZbirFun (int n=2)
| explicit ZbirFun (int n=2) strana: 197 | red: ↓1
| int Predmet::ukId = 0, Predmet::nivo = 0; } // namespace Predmeti #endif ——————————————————————————————————————————— // telo.h
|
} // namespace Predmeti
#endif
———————————————————————————————————————————
// predmet3.C - Zajednički atributi
// klase apstraktnih predmeta.
#include "predmet3.h"
int Predmeti::Predmet::ukId = 0,
Predmeti::Predmet::nivo = 0;
———————————————————————————————————————————
// telo.h
strana: 197 | red: ↑7
|
{ return 3 * r * r * r * 3.14159 / 4; }
|
{ return 4 * r * r * r * 3.14159 / 3; }
|
Copyright © 2012, Laslo Kraus
Poslednja revizija: 11.12.2012.