473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to utilize internal file.

Hi everyone!
Can someone tell me if it is possible to use the file operators on a
constant string? And if so, how?
Thx so much!

Giuseppe
Dec 23 '07 #1
4 1297
mo****@studiomonaribartoletti.191.it said:
Hi everyone!
Can someone tell me if it is possible to use the file operators on a
constant string?
C doesn't have any file operators, so no, it's not possible. If you want to
read data from a string rather than from a stream, simply copy what you
want from the string. Easy.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Dec 23 '07 #2
mo****@studiomonaribartoletti.191.it wrote:
Hi everyone!
Can someone tell me if it is possible to use the file operators on a
constant string? And if so, how?
Thx so much!
There is nothing called "file operators" in C. C implements files
through streams. Writing a string to a stream or reading from a string
to construct a string are trivial. Please give more details for better
responses.

Dec 23 '07 #3
mo****@studiomonaribartoletti.191.it wrote:
# Hi everyone!
# Can someone tell me if it is possible to use the file operators on a
# constant string? And if so, how?

stdio does not generally allow this. Some implementations, but in general,
no.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
Why are we here?
whrp
Dec 23 '07 #4
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"
Dec 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: qazmlp | last post by:
const has internal linkage in C++, but external linkage in C. Am I right ? But, linker reports multiply-defined error if the following header is included in multiple .cpp files. //...
6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
6
by: Christopher Benson-Manica | last post by:
Just FMI, if an external stylesheet is linked to a page (with <link>), will subsequent <style> tags override the values in the external stylesheet? -- Christopher Benson-Manica | I *should*...
2
by: msnews.microsoft.com | last post by:
How can we access an internal class in a referenced file in a multi-file assembly. All documentation states the obvious purpose of the internal keyword on a class, but when referencing an...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
2
by: Chien Lau | last post by:
I frequently define internal UserControl-derived classes in my WinForms apps: internal class MyUserControl:UserControl{ ... } I'll often need to embed these controls in a Form, whose class...
16
by: NOtcarvinSPAM | last post by:
It occurs to me that if I have a work object that gets executed via QueueUserWorkItem AND the work proc accesses only that object's instance data I STILL may have to lock because the object...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
1
by: kvarada | last post by:
Hello Experts, I am building my application on WinNT.4.0_i386_MSVC.7.1 platform. When I build the application on a stand alone machine, it builds fine. But when I build the same application from a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.