--- rachman <[EMAIL PROTECTED]> schrieb: > Saya baru belajar link
list menggunakan bahasa c, dan membuat sebuah
> program sederhana seperti dibawah ini, setelah dicompile pake gcc
> muncul
> error "dereferencing pointer to incomplete type".
> Kira2 apa penyebab terjadinya error tersebut???.
>
> #include <stdio.h>
>
> typedef struct
> {
> char nama[100];
> char alamat[200];
> struct s_notes *link;
> } s_notes;
>
> struct s_notes *notes,*tempnotes,*homenotes;
>
Tipe data s_notes sekarang adalah tipe data struct {...}
Mustinya keyword struct di atas dihilangkan jadi tinggal:
s_notes *notes,*tempnotes,*homenotes;
> int main()
> {
> homenotes=NULL;
> tempnotes=(struct s_notes *)malloc(sizeof(s_notes));
Keyword struct di atas juga musti dihilangkan
> tempnotes->link=NULL; // Error berada pada baris ini
> free(tempnotes);
> }
Eko
__________________________________________________________________
Gesendet von Yahoo! Mail - http://mail.yahoo.de
Sie brauchen mehr Speicher f�r Ihre E-Mails? - http://premiummail.yahoo.de
--
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3