C

Opaque pointers (incomplete types)

Në shqip: Pointer-ët e errët

ShpjegimiSQ

Me një pointer „të errët“, header-i thotë vetëm struct Lidhja; pa treguar çfarë ka brenda, dhe përdoruesit e trajtojnë vetëm përmes funksioneve. Kështu fsheh detajet — si FILE* i stdio.h.

EnglishEN

With an “opaque” pointer, the header says only struct Connection; without showing what's inside, and users handle it only through functions. That hides the details — like stdio.h's FILE*.

Si ta mendosh

Si telekomanda: i shtyp butonat, por s'e sheh qarkun brenda.

Lexoje në anglisht

Like a remote control: you press the buttons but never see the circuit inside.

Shembull kodic

// lidhja.h
typedef struct Lidhja Lidhja;
Lidhja *lidhu(const char *adresa);
void mbyll(Lidhja *l);

Terma të lidhur