12.07.2015 Views

C++ - VideoTutorials-bg.com

C++ - VideoTutorials-bg.com

C++ - VideoTutorials-bg.com

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Установяване на итератора в началотоtemplate void LList::IterStart(elem *p){if (p) Current = p;else Current = Start;}Преместването на указателя Current в следващата позиция сеосъществява чрез член-функцията Iter.Установяване на итератора в следващата позицияtemplate elem* LList::Iter(){elem *p = Current;if (Current) Current = Current->link;return p;}Като използваме член-функциите, реализиращи основните операции заработа с итератора, член-функцията print() на шаблона LList може дасе реализира и по следния начин:template void LList::print(){IterStart();while (Iter()){cout inf

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!