sobota, 26 grudnia 2009

Play Station 2 SLIM OKAZJA STAN IDEALNY Z przeróbką

     Zapraszam wszystkich zainteresowanych do aukcji allegro PS2 SLIM MODBO 760 . Mam do sprzedania konsole Sony Play Station 2 Slim w wersji idealnej. Konsola posiada przeróbkę czyli gramy we wszystko:):)

czwartek, 24 grudnia 2009

Implementacja listy dwukierunkowej w języku C++ (obiektowo)

#include
using namespace std;

class node{
public:
int value;
class node *next;
class node *prev;

node(int v){  //konstruktor
value=v;
}
};

class node *head=NULL;
class node *element=NULL;
class node *temp=NULL;


class node *push(class node *head, int val)
{
    if(head==NULL)
    {
     head =new node(val);  // nowy obiekt klasy node
     //head->value=val;
     head->prev=NULL;
     head->next=NULL;
     temp=head;
      return head;
     }else{
     element=new node(val);
     //element->value=val;
     element->prev=temp;
     temp->next=element;
     element->next=NULL;
     temp=element;
     }
   

}





void show(class node *head){

while(head!=NULL){
cout<<(head->value)<<"\n";
head=head->next;
}

}








int main(){

int value;

for(int i=0;i<10;i++)
{
head=push(head, i);
}

show(head);


}