Yohanes Nugroho wrote:
>
> On Thu, 19 Oct 2000, Agus Budy Wuysang wrote:
>
> > > artinya compiler akan menyediakan suatu tempat dimemori (dan tidak ada
> > ^^^^^^^^^
> > > jaminan bahwa lokasinya dapat ditulisi) yang berisi string tersebut, lalu
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Ah, saya sendiri baru tahu... ini berarti
> >
> > ptrString[0] = 'x';
> >
> > bisa saja gagal pada C compiler tertentu?
>
> gagal dalam arti mengakses memori yang tidak boleh diakses.
> Dengan gcc, hasilnya 'segmentation fault' di Turbo C (di dos)
> mungkin tidak apa-apa (karena sistem operasinya tidak membatasi
> suatu program untuk tidak menulis/membaca alamat memori tertentu.
> [yohanes@merapi yohanes]$ cat dd.c
Arrgh baru ingat lagi!
int main(void)
{
string s[] = "saya dicopy dulu ke char array s :)"
char *p;
p = s;
p[0] = 'x'; /* NOT segv */
p = "constant string";
p[0] = 'x'; /* segv */
return 0;
}
--
+---| Netscape Communicator 4.x |---| Powered by Linux 2.2.x |---+
|/v\ Agus Budy Wuysang MIS Department |
| | Phone: +62-21-344-1316 ext 317 GSM: +62-816-1972-051 |
+--------| http://www.rad.net.id/users/personal/s/supes |--------+
--------------------------------------------------------------------------------
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3
Pengelola dapat dihubungi lewat [EMAIL PROTECTED]
- Re: [programming] call by reference di c for linux Ronny Haryanto
- Re: [programming] call by reference di c for linux Yohanes Nugroho
- Re: [programming] call by reference di c for linux Yohanes Nugroho
- Re: [programming] call by reference di c for linux Danny Setiawan
- Re: [programming] call by reference di c for linux Benny Prijono
- Re: [programming] call by reference di c for linux Agus Budy Wuysang
- Re: [programming] call by reference di c for linux Agus Budy Wuysang
- Re: [programming] call by reference di c for linux Agus Budy Wuysang
- Re: [programming] call by reference di c for linux Yohanes Nugroho
- Re: [programming] call by reference di c for linux Agus Budy Wuysang
- Re: [programming] call by reference di c for linux Edwin Pratomo
- Re: [programming] call by reference di c for linux Ronny Haryanto
- Re: [programming] call by reference di c for linux Steven Haryanto
- Re: [programming] call by reference di c for linux Oki DZ
- Re: [programming] call by reference di c for linux Ikhlasul Amal
- Re: [programming] call by reference di c for linux Yohanes Nugroho
- Re: [programming] call by reference di c for linux Agus Budy Wuysang
- Re: [programming] call by reference di c for linux Oki DZ
- Re: [programming] call by reference di c for linux Benny Prijono
- Re: [programming] call by reference di c for linux Yohanes Nugroho
