|
|
On 4 Jun 1999 03:19:12 -0500, Nieminen Mika wrote:
>Ralf Muschall <rmu### [at] t-onlinede> wrote:
>: Probably because nobody wanted to write such a function,
>: ANSI libc.a does not contain one, and POV was written in a
>: time before GNU hackers told that all limits are evil.
>: AFAIK glibc has an extension (getline) which does the job.
>
> filepos=ftell(InFile);
> for(i=StartingQuoteIndex+1; getc(InFile)!='"'; i++);
> fseek(filepos);
> char* String=malloc(i-StartingQuoteIndex-1);
> fgets(String, i-StartingQuoteIndex-1, InFile);
>
> What's so difficult here?
This, from the docs:
Note if you need to specify a quote mark in a string literal you must precede
it with a backslash. For example
"Joe said \"Hello\" as he walked in."
is converted to
Joe said "Hello" as he walked in.
If you need to specify a backslash, most of the time you need do nothing
special. However if the string ends in a backslash, you will have to specify
two. For example:
"This is a backslash \ and so is this\\"
Is converted to:
This is a backslash \ and so is this\
Not that it's insurmountable or anything, but it does make the job a little
more interesting than what you have there.
Post a reply to this message
|
|