Version française
Home     About     Download     Resources     Contact us    
Browse thread
open_file
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] open_file
Karl Zilles <zilles@1969.ws> writes:

> let buff = "empty";;
>
>> let main () =
>>   let file_content = read file_reader !buff 1 5 in
>
> let file_content = read file_reader buff 0 5 in

You should not modify string literals, because they are allocated
statically. Use String.create to make a fresh string.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/