Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторная работа 11 / CELEMENT
.CPP//File celement.cpp
//Naznachenie: Opredelenie funkcij klassa "elementy spiska"
//Author: Pavel Morozov
//Redakcija: 1.0 10.02.07
#ifndef celement_cpp
#define celement_cpp
#include<iostream.h>
#include<math.h>
#include<conio.h>
#include<stdio.h>
#include"celement.h"
//--------------------Konstruktory--------------------------
CElement::CElement(float F0ptr)
{
Fptr=F0ptr;
Next=NULL;
}
CElement::CElement(CElement &El, CElement *Next0 )
//Konstruktor kopirovanija
{
Next=Next0;
textcolor(10);
Fptr=El.GetFptr();
cout<<endl;
cprintf("Konstruktor kopirovanija CElement sozdal");
cprintf(" Kopiju elementa, znachenie problemnoj chasti kotorogo ravno ");
cout<<Fptr<<endl<<endl;
textcolor(15);
}
//--------------Funkcii interfeisa-----------------------
void CElement::SetFptr( float F0ptr )
//Ustanovit ukazatel na element
{ Fptr=F0ptr;}
void CElement::SetNext( CElement *E)
//Ustanovit ukazatel na sledujushij element
{ Next=E; }
float CElement::GetFptr()
{ return Fptr; }
//Poluchit ukazatel na element
CElement *CElement::GetNext()
//Poluchit ukazatel na sledujushij element
{ return Next;}
//-------------------------Destruktor-------------
CElement::~CElement()
{ float x0;
cout<<endl;
cprintf("~CElement razrushaet element klassa...");
cout<<endl;
if (Fptr)
{
//Fptr-> GetFptr(x0);
cout<<endl;
cprintf("Zanchenie elementa ");
cout<<Fptr<<endl;
// delete Fptr;
cout<<endl;
cprintf("Element unichtozen...");
cout<<endl;
cprintf("Nazmite probel...");
cout<<endl;
getch();
}
}
#endif
Соседние файлы в папке Лабораторная работа 11