473,385 Members | 1,893 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,385 software developers and data experts.

Declaring Strings

Hi everybody,

My question is whether there is a method of declaring an array whose parameters are the contents of an entire file without copying and pasting? If you can hint at a function or two that can point me in the right direction I would greatly appreciate it.

Thanks.
Nov 22 '08 #1
3 1451
oler1s
671 Expert 512MB
My question is whether there is a method of declaring an array whose parameters are the contents of an entire file without copying and pasting?
Explain what you mean because your technical terminology is a bit wonky.
Nov 22 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
If I read your question correctly, you want to use the disc file irtself as an array.

That works fine if the disc file is not in binary. You can use seek/tell to move around in the file. This also allows updating the file directly in as random manner.
Nov 23 '08 #3
JosAH
11,448 Expert 8TB
@weaknessforcats

Most (if not all) unix systems even have mmap() and munmap() functionality that maps (part of) the file directly to virtual memory. It circumvents a few read/write disk buffers as well. I don't know whether or not MS Windows offers that facility but they're nuts if they don't.

kind regards,

Jos
Nov 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: arekkusu | last post by:
Hello, I have the following problem: when declaring hex data in C, you typically do something like: const char = {0xde, 0xad, 0xbe, 0xef, 0x01, 0x02, 0x03, 0x04 ... }; This is quite verbose...
1
by: Maarten Terlingen | last post by:
Sample: ClassA: ClassB ClassB: ClassC ClassA x = new Class C I want to know the declaring type of C. x.GetType() returns C x.GetType().BaseType returns B x.GetType().BaseType.BaseType...
3
by: darrel | last post by:
Often, I want to use a string in multiple functions on a page. I can declare and re-set the string in each function, or I can just delcare the string outside of the individual functions so that...
3
by: Buddy Robbins | last post by:
Hey folks, I'm trying to use the PathCleanupSpec function from the shell library. The function prototype is: int PathCleanupSpec( LPCWSTR pszDir, LPWSTR pszSpec) In the old days of VB6, I...
4
by: snow.carriers | last post by:
http://www.rafb.net/paste/results/fTQgRW16.html Here's my program so far. This is what I'm trying to do: http://contest-cemc.uwaterloo.ca/ccc/2005/senior/phone.pdf So far it works fine. The only...
15
by: edson | last post by:
Greetings. My microcontroller program uses arrays of strings. I want to store the strings AND their pointers in ROM. I am able to initialize the arrays so that the strings are put in ROM, but the...
9
by: andreyvul | last post by:
I'm trying to do the following: typedef struct { char *bar; char **baz; } foo; const foo fop = { { "foo", { "bar", "baz", "bax" } }, { "goo", { "car", "cdr", "cfr" } }
8
by: bintom | last post by:
What are the differences between the following methods of declaring strings? char string1 = "C++ forum"; char* string2 = "C++ forum"; I know that the first uses the array notation, whereas...
1
by: JLORA3659 | last post by:
dsPlcTagDataSet = new DataSet(); dsPlcTagDataSet.ReadXml(Application.StartupPath + "\\" + "PlcTag.xml"); in the xml file there is a row "iWord" that I need to sort later on but this row is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.