# data[].attributes.attachment_link.readable_text
#include <iostream>
using namespace std;
     
// H klash mas
class Circle {
  private:
    float x,y;	// to kentro tou kuklou
    float r;	// h aktina
  public:
 	Circle(){ x=y=0;  r=1;  }		// Aplos constructor, xwris orismata
	Circle(float X, float Y, float R){ x=X;y=Y;r=R;	}	// Constructor pou gemizei kentro kai aktina
    void	setRadius(float R) { if(R>=0) r=R; 	}
    void	setCenter(float X, float Y) { x=X; y=Y; } 
    float	getRadius() { return r;	}
    float	getArea();
    float	getPerimeter() { return 6.28*r; }
    void	print();	// Gia na emfanizetai omorfa o kuklos
};
 
float	Circle::getArea(){
	return 3.14*r*r;
} 

void	Circle::print(){
	cout << "O kuklos sto shmeio (" << x << "," << y << ") exei aktina " << r << endl;
}

int main () {
	
	// To c1 ftiaxnetai me ton aplo constructor 
	Circle	c1;
	c1.print();
	cout << "EMBADO c1 " << c1.getArea() << endl;
	c1.setRadius(10);
	c1.print();
	cout << "EMBADO c1 " << c1.getArea() << endl;
	
	// To c2 ftiaxnetai me ton 2o constructor
	Circle	c2(1,2.3,7);
	c2.print();
	cout << "EMBADO c2 " << c2.getArea() << endl;
	cout << "PERIMETROS c2 " << c2.getPerimeter() << endl;
	c2.setRadius(5);
	c1.print();
	cout << "EMBADO c2 " << c2.getArea() << endl;
	cout << "PERIMETROS c2 " << c2.getPerimeter() << endl;
	
	// To c3 ftiaxnetai dunamika me ton 1o constructor
	Circle	*c3 = new Circle;
	c3->print();
	cout << "Embado: c3 "<< c3->getArea();
	
	// To c3 ftiaxnetai dunamika me ton 1o constructor
	Circle	*c4 = new Circle(0,0,4);
	c4->print();
	cout << "Perimetros: c4 "<< c4->getPerimeter();
	
}


# data[].attributes.headline
stuck.c (υλοποίηση Στοίβας στη C)

# data[].attributes.subject
stuck.c (υλοποίηση Στοίβας στη C)

# data[].attributes.attachment_link.readable_text
/*	stack.c
	Ylopoihsh stoibas pou periexei shmeia sto epipedo
*/

#include <stdio.h>		// basikh biblio8hkh
#include <malloc.h>		// dunamikh paraxwrhsh mnhmhs
#include <stdlib.h>		// gia thn exit()
#include <math.h>		// gia th rand()
#include <time.h>

typedef struct shmeio shmeio;	// suntomo onoma gia to 'struct shmeio'
typedef shmeio * stoiba;		// mia stoiba einai enas pointer se shmeio

struct shmeio {
	float	x,y;	// suntetagmenes x kai y shmeiou sto epipedo
	char	name;	// suntomo onoma
	shmeio	*next;	// pointer sto epomeno shmeio
};

// ---------- Leitourgies sto shmeio ----------

// Tupwnei omorfa ena shmeio
void	shmeio_print(shmeio *ptr){
	printf("%c(%.3f,%.3f)   ", ptr->name, ptr->x, ptr->y);
}

// Dhmiourgei ena kainourgio shmeio kai to gemizei me dedomena
shmeio *shmeio_construct(float x, float y, char n){
	shmeio *ptr;
    if(!(ptr=malloc(sizeof(shmeio))))	// pare mnhmh gia ena shmeio
    	exit(-1);
    ptr->name=n;
    ptr->x=x;
    ptr->y=y;
	ptr->next=NULL;		// shmantiko na mhn exei epomeno
}

// ---------- Leitourgies sth stoiba ----------

// Tsekarei an h stoiba einai adeia
char	stack_isempty(stoiba s){
	return s==NULL;
}

// Metraei ta kommatia ths stoibas
int		stack_length(stoiba s){
	int l=0;
	while(s){
		s=s->next;
		l++;
	}
	return l;
}

// Eisagei ena neo shmeio sth stoiba
stoiba	stack_push(stoiba s, shmeio *p){
	p->next = s;
	s = p;
	return s;
}

// Ejagei ena shmeio ap th stoiba kai epistrefei deikth s'auto
// pername deikth sth stoiba gia na mporoume na thn allajoume
// epistrefei NULL an einai kenh
shmeio *stack_pop(stoiba *sp){
	shmeio *p;
	if(stack_isempty(*sp))
		return NULL;
	p=*sp;
	*sp=(*sp)->next;
	return p;
}

// Tupwnei oloklhrh th stoiba
void	stack_print(stoiba s){
	shmeio *i=s;
	printf("Stack at address %d with %d nodes:\n",s,stack_length(s));
	while(i!=NULL) {
		shmeio_print(i);
		i=i->next;
	}
	printf("\n");		
}

int	main(){
    stoiba s1, s2;	// Orizei duo kenes stoibes
    
    shmeio a = { 2.1, 3.67, 'A', NULL};	// ena neo shmeio
    shmeio *ptr;			// deikths (pointer) se nea shmeia
    int	i;
    time_t	t;
	
	s1=NULL;
	stack_print(s1);			// s1:{} dld kenh
	
    s1=stack_push(s1,&a);
    stack_print(s1);			// s1:{A}

    ptr=malloc(sizeof(shmeio));
    if(!ptr) 			// panta elegxoume an mporese na mas dwsei mnhmh
		exit(-1);
    ptr->name='B';
    ptr->x=-2;
    ptr->y=5;
	ptr->next=NULL;		// shmantiko na mhn exei epomeno
	s1=stack_push(s1,ptr);
    stack_print(s1);			// s1:{B,A}

    if(!(ptr=malloc(sizeof(shmeio))))	// akomh pio mazemeno
    	exit(-1);
    ptr->name='C';
    ptr->x=6.3;
    ptr->y=54;
	ptr->next=NULL;		// shmantiko na mhn exei epomeno
	s1=stack_push(s1,ptr);
    stack_print(s1);			// s1:{C,B,A}
    
    ptr=shmeio_construct(9.1,4.5,'D');
	s1=stack_push(s1,ptr);
    stack_print(s1);			// s1:{D,C,B,A}
    
    ptr=stack_pop(&s1);
    shmeio_print(ptr);
    stack_print(s1);
    
    s2=NULL;
    srand((unsigned) time(&t));
    for(i=0;i<6;i++){
    	ptr=shmeio_construct(rand()%1000/100.0,rand()%1000/100.0,'a'+i);	// a,b,c,d,...
    	s2=stack_push(s2,ptr);
    	stack_print(s2);
	}
	
	for(i=stack_length(s1);i>0;i--){
		ptr=stack_pop(&s1);
		s2=stack_push(s2,ptr);
	}
	stack_print(s1);
	stack_print(s2);
}

# data[].attributes.attachment_link.readable_text
#include <stdio.h>

typedef struct ABC abc;

struct {
    int a;
    float b;
    char c;
} ABC;

int main(int argc, char const *argv[])
{
    abc x1;

    x1.a=3;
    x1.b=3.14;
    x1.c='W';

    printf("x1: %d, %f, %c\n", x1.a, x1.b, x1.c );

    return 0;
}

# data[].attributes.headline
Εισαγωγή στη C++ [το βασικό βιβλίο μας]

# data[].attributes.subject
Εισαγωγή στη C++ [το βασικό βιβλίο μας]

# data[].attributes.headline
Link για το υλικό του μαθήματος

# data[].attributes.subject
Link για το υλικό του μαθήματος

# data[].attributes.attachment_link.title
_Γλώσσα Προγραμματισμού ΙΙ - C++

# data[].attributes.headline
Δυναμική διαχείριση μνήμης

# data[].attributes.subject
Δυναμική διαχείριση μνήμης

# data[].attributes.attachment_link.title
Δυναμική διαχείριση μνήμης

# data[].attributes.headline
Εισαγωγή στη γλώσσα προγραμματισμού C++

# data[].attributes.subject
Εισαγωγή στη γλώσσα προγραμματισμού C++

# data[].attributes.attachment_link.title
Εισαγωγή στη γ.π. C++ Π.Κρήτης Σταματιάδης