mo****@studiomonaribartoletti.191.it writes:
Can someone tell me if it is possible to use the file operators on a
constant string? And if so, how?
As others have mentioned, C has no file operators. Operations on
files are performed using function calls.
I *think* you're asking about how to treat an in-memory string as if
it were a file. There is no general mechanism for doing this, but
there are equivalents for certain specific functions; see sprintf and
sscanf, for example.
(Note that the form and meaning of the filename argument to fopen()
are implementation-defined. Conceivably an implementation could
provide a form of filename that refers to a string or other in-memory
buffer. I'm not aware of any implementations that do this.)
--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"