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

Strings!

Hi!

I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)

2) Is more (time) efficient the allocation of strings in the heap or in
the stack?

3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?

4) Exists a function that return a substring (from a start element to a
finish element) of a string?

5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?

Thank you in advance

--
Il Prof.
Nov 14 '05 #1
23 1840
Il Prof <ch*********@chiedisulng.org> wrote:
I'm new in C language (but not in structured programming) and i have
some questions about strings: 1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
An access like myarray[i] is just a fancy way of writing *(myarray+i)
(that's what the compiler is going to translate it to), so there
shouldn't be much of a difference. Further, the C standard isn't
making any statements about the speed of any operations, so the
question could, if at all, only be answered for a certain imple-
mentation. But with questions like that you would be off-topic here
since that's not a question about C but some implementation of it.
2) Is more (time) efficient the allocation of strings in the heap or in
the stack?
First of all, neither the term "stack" or "heap" are mentioned in
the (C89) standard at all, so there's really no answer to begin with.
But arguing from how things normally get implemented you can't
compare allocation on the heap (that's what you typically do when
you call malloc()) and allocation on the stack (when you define
an array in a function) - in the first case you do dynamical
allocation and in the second you "allocate" a fixed length array
(unless you have a C99-compliant compiler where variable length
arrays have been introduced - but you still will get only a string
that you can use in the current function, in contrast to a string
allocated with malloc(), which can be used also everywhere else).
But in any case the only possible answer is that it depends on the
implementation you're using as well as the hardware you're using it
with.
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?
If you want to copy a string then strcpy() and strncpy() would be
the usual suspects.
4) Exists a function that return a substring (from a start element to a
finish element) of a string?
Now, this depends on what you want to return from the function. If it's
a pointer to that substring (but not a real new string, i.e. just a
pointer pointing within the original string) than you would just return
the sum of the pointer to the start of the old string and the offset of
the substring, relative to the start of the original string. If you want
to return a new string then you have to allocate memory for the substring
and copy the part of the original string you want into the new string.
There's no standard function that does all that - but there are probably
dozends of libraries with functions like that.
5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?


Since there are probably thousands and thousands quite useful non-ANSI
libraries you will have to specify what kind of functionality you're
interested in. But since a non-ANSI library will typically be platform
dependend you probably will be better of asking in a group concerned
with your platform.
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #2

"Il Prof" <ch*********@chiedisulng.org> wrote

I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
Very unlikely to be a difference. In the olden days the pointer method was
usually faster (because the array required an address calculation, but
modern hardware will do it in the same instruction).
2) Is more (time) efficient the allocation of strings in the heap or in
the stack?
The stack. The heap requires you to call malloc() and free() which are
non-trivial, though not slow. The stack normally just requires a subtraction
from the stack pointer.
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?
char str[64];

strcpy(str, "This is a string");
4) Exists a function that return a substring (from a start element to a
finish element) of a string?
No. You could write one (you could either return a string allocated with
malloc, or pass in a buffer). Some functions, like strstr and strchr return
pointers within the passed string, but no standard library function returns
a sub string.
5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?

This will create a flame war. I would say no. The problem is that string
handling is such a basic operation, that if you use a thrid party library
you create a dependency throughout all your code. This is generally a bad
thing. So it is best to stick to stdlib functions for your string handling.
However you could look at say the Microsoft "safe" string library, if you
want to go down that route, and I think Jacob Navia also has a library he is
happy to give out.
Nov 14 '05 #3
>I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
ANSI C does not guarantee that aything is faster than or slower
than or about the same speed as anything else (especially
if you do not specify hardware, OS, compiler, compiler version,
compiler serial number, etc.).
2) Is more (time) efficient the allocation of strings in the heap or in
the stack?
No. Neither place is guaranteed to exist.
In general, allocation of auto variables is faster than calling
malloc(). No guarantees.
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?
strcpy(), strncpy(), and sprintf() are commonly used, among
lots of other possibilities.
4) Exists a function that return a substring (from a start element to a
finish element) of a string?
If the end of the string and the end of the substring are not in
the same place, you will have to copy or modify the original string.

String positions in a string of length n are numbered from 0 to n-1.
To copy position i thru position j, inclusive, of a string to
another string:

strncpy(new_buffer, old_buffer + i, j-i+1);
new_buffer[j-i+1] = '\0';

however, this may misbehave badly if j < i, or either i or j references
positions outside the original string.
5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?


The MySQL client library. See http://www.mysql.org/ .

Gordon L. Burditt
Nov 14 '05 #4
Malcolm wrote:
"Il Prof" <ch*********@chiedisulng.org> wrote
I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)


Very unlikely to be a difference. In the olden days the pointer method was
usually faster (because the array required an address calculation, but
modern hardware will do it in the same instruction).


Correct, but the historical note is not completely correct. There's
been documented instances of each method being faster than the other.
In particular, I seem to recall early versions of gcc being able to
unroll some array access loops better, resulting in faster code under
some levels of optimization.

To the OP: do whatever seems more natural for the particular instance,
and only change it if there's hard evidence of your compiler pessimizing
your code.
Mark F. Haigh
mf*****@sbcglobal.net

Nov 14 '05 #5
Je***********@physik.fu-berlin.de wrote:

[1) & 2)]
But with questions like that you would be off-topic here
since that's not a question about C but some implementation of it.
A good ng for these questions about gcc in Linux ix86 environment?
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?

If you want to copy a string then strcpy() and strncpy() would be
the usual suspects.


I have something like this:

char mystring[]="Hello world";
....
//here i would to assig a new value to mystring
Since there are probably thousands and thousands quite useful non-ANSI
libraries you will have to specify what kind of functionality you're
interested in.


I'm interested in string, file and trie (a kind of tree data structre)
manipulation libraries (gcc,linux2.4,ix86); can you suggest me anything
on these topics?

Thank you so much for your answers
--
Il Prof.
Nov 14 '05 #6
"Malcolm" <ma*****@55bank.freeserve.co.uk> wrote:
char str[64];

strcpy(str, "This is a string");
But if the code was:

char str[64] = "This is a longer string";
strcpy(str, "This is a string");

Now str is "This is a string string" or "This is a string"?
This will create a flame war.
Sorry for this question :)
However you could look at say the Microsoft "safe" string library, if you
want to go down that route, and I think Jacob Navia also has a library he is
happy to give out.


And for ix86 Linux platform?

Thank you for you support :)

--
Il Prof.
Nov 14 '05 #7
go***********@burditt.org (Gordon Burditt) wrote:

[cut]

Thanks for all the good answers! :)

--
Il Prof.
Nov 14 '05 #8
Il Prof <ch*********@chiedisulng.org> wrote:
Je***********@physik.fu-berlin.de wrote: [1) & 2)]
But with questions like that you would be off-topic here
since that's not a question about C but some implementation of it.
A good ng for these questions about gcc in Linux ix86 environment?
You seem to have found one already;-)
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?

If you want to copy a string then strcpy() and strncpy() would be
the usual suspects.

I have something like this: char mystring[]="Hello world";
That's completely ok, but only works in the definition of that array
because it's just a convenient way of writing the more explicit form

char mystring[] = { 'H', 'e', 'l', 'l', 'o', ' ',
'w', 'o', 'r', 'l', 'd', '\0' };
...
//here i would to assig a new value to mystring


Then you have to use one of the functions like strcpy() and strncpy().

Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #9
Je***********@physik.fu-berlin.de wrote:
Il Prof <ch*********@chiedisulng.org> wrote:
.... snip ...
//here i would to assig a new value to mystring


Then you have to use one of the functions like strcpy() and strncpy().


I can guarantee to perform that operation without those
functions. i.e. I object to the words "have to".

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush.
"Churchill and Bush can both be considered wartime leaders, just
as Secretariat and Mr Ed were both horses." - James Rhodes.
"If I knew then what I know today, I would still have invaded
Iraq. It was the right decision" - G.W. Bush, 2004-08-02
Nov 14 '05 #10
CBFalconer <cb********@yahoo.com> wrote:
Je***********@physik.fu-berlin.de wrote:
Il Prof <ch*********@chiedisulng.org> wrote:
... snip ...
> //here i would to assig a new value to mystring


Then you have to use one of the functions like strcpy() and strncpy().

I can guarantee to perform that operation without those
functions. i.e. I object to the words "have to".


Of course, you're correct, a simple

char mystring[ 12 ];
char *dest = mystring;
char *src = "Hello world";
while ( *dest++ = *src++ )
/* empty */ ;

would be an alternative to using strcpy(), one for strncpy() is left
an exercise to the reader;-)
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #11

<Je***********@physik.fu-berlin.de> wrote in message
news:2n************@uni-berlin.de...
CBFalconer <cb********@yahoo.com> wrote:
Je***********@physik.fu-berlin.de wrote:
Il Prof <ch*********@chiedisulng.org> wrote:
... snip ...

> //here i would to assig a new value to mystring

Then you have to use one of the functions like strcpy() and strncpy().

I can guarantee to perform that operation without those
functions. i.e. I object to the words "have to".


Of course, you're correct, a simple

char mystring[ 12 ];
char *dest = mystring;
char *src = "Hello world";
while ( *dest++ = *src++ )
/* empty */ ;


This never works !
Moreover.. Where is the '\0' ???

would be an alternative to using strcpy(), one for strncpy() is left
an exercise to the reader;-)

Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de

Nov 14 '05 #12
Ravi Uday <ra******@gmail.com> wrote:
<Je***********@physik.fu-berlin.de> wrote in message
Of course, you're correct, a simple

char mystring[ 12 ];
char *dest = mystring;
char *src = "Hello world";
The '\0' is right at the end of this string, even though you don't
"see" it - it's there automatically because the text is enclosed in
double quotes.
while ( *dest++ = *src++ )
/* empty */ ;
This never works !
But it does! At the very start 'src' points to the first char of the
literal string "Hello word" and 'dest' to the first element of the
char array 'mystring'. Now the whole thing in parentheses copies what
'src' is pointing to to what 'dest' is pointing to (please note that
there's a single '=' in the middle, not a '==', so it's an assignment
and not a comparison) and afterwards increments both 'src' and 'dest'
The "result" (i.e. what the expression evaluates to) is the char you
just copied and, as long as that isn't '\0', the loop is repeated,
successively copying all chars from the source to the destination
string.

This is nothing more than a copy from K&R2, chapter 5, section 5.5.
I just added the comment to indicate that having an empty body for
the while loop is intended and not a mistake.
Moreover.. Where is the '\0' ???


That's the last char that will be copied. When it has been copied
the loop controlling expression will be 0 and the loop stops. Both
'dest' and 'src' end up pointing directly after the ends of the
strings.
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #13
Il Prof wrote:

"Malcolm" <ma*****@55bank.freeserve.co.uk> wrote:
char str[64];

strcpy(str, "This is a string");


But if the code was:

char str[64] = "This is a longer string";
strcpy(str, "This is a string");

Now str is "This is a string string" or "This is a string"?


The second one. The null terminator will be copied.

What C book are you using that doesn't explain how strcpy() works?

Brian Rodenborn
Nov 14 '05 #14
Default User <fi********@boeing.com.invalid> wrote:
What C book are you using that doesn't explain how strcpy() works?


I haven't yet a book...i think to buy the Kernighan&Ritchie.

--
Il Prof.
Nov 14 '05 #15
I'm still a C apprentice But I noticed some of the answers on this
board and Wanted to give my two cents and get corrected if wrong.
1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
Array notation is really just an abstraction for the programmer to
access an array is it not? C treats arrays internally with pointer
notation. As a result would that not be faster? My book C primer plus
4th edtion. Seems to say that. Ptr notation Espeacially when used with
the increment operators are much faster.
Consider the following code from a recent tutorial:
/* copying a string */
strcpy(char s1[],char s2[])
{
int x;
for (x=0; x<=strlen(s2); x++)
s1[x]=s2[x];
}

/*second fragment */

strcpy(char *s1,char *s2)
{
while (*s2 != '\0')
{
*s1 = *s2;
s1++;
s2++;
}
}

/* third fragment */
strcpy(char *s1,char *s2)
{
while (*s2)
*s1++ = *s2++;
}
/* foruth fragment */

while (*s1++ = *s2++);

//and the results accoriding to the authour:
"The first version of strcpy takes 415 seconds to copy a 120-character
string 10,000 times, the second version takes 14.5 seconds, the third
version 9.8 seconds, and the fourth 10.3 seconds. As you can see,
pointers provide a significant performance boost here."
4) Exists a function that return a substring (from a start element to a
finish element) of a string?
Maybe I'm understanding the question incorrectly. But does he mean
basically slcing the string up to a certain element. If so The
standard library function puts takes a pointer as an argument and
returns that string. It starts from whatver address you give it and
increments addreses up to till the null character. Consider the
following code:
/* returning a substring from x element to y */
#include <stdio.h>
#define DEF "I am a symbolic string constant."
int main(void)
{
char str1[80] = "How much of me will be returned??hmm lets see...";
const char * str2 = "A pointer was initialized to me.";

puts("I'm an argument to puts().");//just feed it an address
puts(DEF);
puts(&str1[0]);/*starts printing from where you indicate all needs
is an addy*/
puts(str1);
puts(str2);
puts(&str1[5]);
puts(str2+4);
getchar();
return 0;
}
//and the output

I'm an argument to puts().
I am a symbolic string constant.
How much of me will be returned??hmm lets see...
How much of me will be returned??hmm lets see...
A pointer was initialized to me.
uch of me will be returned??hmm lets see...
inter was initialized to me.
and if you have to print up only to a certain element of a string you
can always manipualte the printf function like so:
/**/
#define DEF "I am a symbolic string constant."

printf("%.10s\n", DEF); //prints up only to 10th character
//end fragment
/* */ If i misunderstood the queston let me know and if there are any
corections let me know. I'm still learning. Thanks,

Nov 14 '05 #16
bi*******@yahoo.com (Michael Scarlett) wrote:
Consider the following code from a recent tutorial: [cut]

Interesting...uhm...very interesting!
Maybe I'm understanding the question incorrectly.


Your idea is very good but i need a fucntion that takes in input a
string (char*) and two integer (start element and the final element of
the array) a gives in output the correct substring (char*). So i don't
want to print the value of the substring in the stout but i would have a
pointer to the array of char for other manipulation in the code.

Thank you very much for your sample code! :)

--
Il Prof.
Nov 14 '05 #17
In article <ce**************************@posting.google.com >,
Michael Scarlett <bi*******@yahoo.com> wrote:
Consider the following code from a recent tutorial:
/* copying a string */
strcpy(char s1[],char s2[])
{
int x;
for (x=0; x<=strlen(s2); x++)
s1[x]=s2[x];
}

/*second fragment */

strcpy(char *s1,char *s2)
{
while (*s2 != '\0')
{
*s1 = *s2;
s1++;
s2++;
}
}


The second one is almost certainly faster because it doesn't call
strlen() everytime through the look. The pointer vs. array usage is
liekly insignifigant in comparison to the time spend doing unnecessary
strlen()'s. Change the first one to calculate the length once in the
beginning, or to terminate with s2[x]==0 rather than based on strlen(),
and the times will likely be a lot closer.

Also, for the record, not all four fragments do the same thing. Some
copy the terminating '\0', some don't.

-- Brett
Nov 14 '05 #18

"Il Prof" <ch*********@chiedisulng.org> wrote in message

Your idea is very good but i need a fucntion that takes in input a
string (char*) and two integer (start element and the final element of
the array) a gives in output the correct substring (char*). So i don't
want to print the value of the substring in the stout but i would have a
pointer to the array of char for other manipulation in the code.

This is easy enough

/*
index is 1 - based, easy enough to convert to zero-based if desired.
*/
void substr(char *out, size_t len, const char *str, int start, int end)
{
assert( start <= end);
assert(start >= 1);
assert(end >= 1);
assert( len > end - start + 2);
assert( end <= strlen(str));

memcpy(out, str + start - 1, end - start + 1);
out[ end - start + 1] = 0;
}

char *substr(const char *str, int start, int end)
{
char *answer;

assert(start <= end);
assert(end <= strlen(str));

answer = malloc( end - start + 2);
if(!answer)
return 0;

memcpy(answer, str + start - 1, end - start + 1);
answer[ end - start + 1] = 0;

return answer;
}

Using the second way you must check for out-of-memory, and also free the
pointer after you have finished using it.
Nov 14 '05 #19
Il Prof wrote:
Default User <fi********@boeing.com.invalid> wrote:
What C book are you using that doesn't explain how strcpy() works?


I haven't yet a book...i think to buy the Kernighan&Ritchie.


A wise decision. I believe there is an Italian edition available.

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - Bush.
"Churchill and Bush can both be considered wartime leaders, just
as Secretariat and Mr Ed were both horses." - James Rhodes.
"If I knew then what I know today, I would still have invaded
Iraq. It was the right decision" - G.W. Bush, 2004-08-02
Nov 14 '05 #20
Il Prof wrote on 04/08/04 :
I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
It depends on the implementation.
2) Is more (time) efficient the allocation of strings in the heap or in
the stack?
It depends on the implementation.
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?
It depends on the usage.

Pointing to a different string is fast and efficient, but it's not
always possible.

char * p = "hello";

if (language == FRENCH)
{
p = "boujour";
}

4) Exists a function that return a substring (from a start element to a
finish element) of a string?
Not directly, but a smart usage of strncat() can help a lot.
5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?


Probably. http://www.snippets.org/ comes to my mind.
I have some here too:

http://mapage.noos.fr/emdel/clib.htm
Module STR (drop me an email if you are stuck)

Google is your friend.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html

"C is a sharp tool"

Nov 14 '05 #21
Il Prof <ch*********@chiedisulng.org> wrote in message news:<if********************************@4ax.com>. ..
Hi!

I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
Probably the latter. Because with the former method, the array will
decay into a pointer to its first element, i will be added, and then
derefenced anyway.

2) Is more (time) efficient the allocation of strings in the heap or in
the stack?
Don't know.
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?
Yes. Strings can not just be assigned in any manner like in other,
higher-level programming languages. One could use strcpy. One could
also use malloc and pointer a pointer to char at what it allocates.
e.g.

unsigned char *foo = (unsigned char *)malloc(80 * sizeof(char));

And then assign chars to the elements of that segment of data through
foo.

4) Exists a function that return a substring (from a start element to a
finish element) of a string?
strstr?

5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?


GLib, which is part of the gtk project at www.gtk.org
If you want to extend your C programs with scripting language, see
www.lua.org.
Nov 14 '05 #22
Foobarius Frobinium wrote on 08/08/04 :
unsigned char *foo = (unsigned char *)malloc(80 * sizeof(char));


Why do you write so complicated code ? What's wrong with

char *foo = malloc(80);

or simply

char foo[80];

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html

"C is a sharp tool"

Nov 14 '05 #23
Il Prof <ch*********@chiedisulng.org> wrote:
I'm new in C language (but not in structured programming) and i have
some questions about strings:

1) What of this two string access methods is faster?
- Direct access of the elemtns of an array of char (myarray[i])
- Access through a pointer to char (*mypointer)
Modern compilers will literally equate the two. I.e., there should be
no difference.
2) Is more (time) efficient the allocation of strings in the heap or in
the stack?
malloc() requires dynamic acquisition of memory which requires some
algorithm to run. If by "stack" you mean auto declarations, then such
memory is usually acquired implicitely, and usually requires no cost
at all.

But you have to understand that semantically the two are different and
you aren't always going to have to option of using one to replace the
other.
3) What is the correct method of assign a new value to a string? Perhaps
the using the strcpy of the new value in the ols string?
strcpy() performs an overwrite of a char buffer with the contents of
another char buffer (they buffers cannot legally overlap.) So if you
use it, you need to acquire a sufficiently sized buffer for the target
string memory first (from an auto buffer, a static/global buffer, or
malloc'ed memory.) Another way of "assigning" a new string value is
to simply copy pointers, however, this generates a reference based
copy (meaning that changes to one will obviously lead to changes in
the other.) So which one is more "correct" depends on the semantics
you want from the operation.
4) Exists a function that return a substring (from a start element to a
finish element) of a string?
In general, not really. What you can do, is acquire seperate memory
for a destination substring, then do something like memcpy(dst, src +
start, len); to copy the substring inner contents, then complete the
operation with dst[len] = '\0';
5) There are some other (non ANSI standard) C libraries that are known
as very useful and often used in practical programming? Some web links
on this?


I have written one:

http://bstring.sf.net/

Certain things such as assignment (bAssign), copying (bstrcpy),
substrings (bmidstr/blk2tbstr) are somewhat more obvious than the way
the C Library works.

However there are many others worthy of consideration:

http://www.and.org/vstr/
http://cr.yp.to/lib/stralloc.html
http://www.annexia.org/freeware/c2lib/index.msp
http://firestuff.org/

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
Nov 14 '05 #24

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

Similar topics

20
by: Ravi | last post by:
Hi, I have about 200GB of data that I need to go through and extract the common first part of a line. Something like this. >>>a = "abcdefghijklmnopqrstuvwxyz" >>>b = "abcdefghijklmnopBHLHT"...
17
by: Gordon Airport | last post by:
Has anyone suggested introducing a mutable string type (yes, of course) and distinguishing them from standard strings by the quote type - single or double? As far as I know ' and " are currently...
16
by: Paul Prescod | last post by:
I skimmed the tutorial and something alarmed me. "Strings are a powerful data type in Prothon. Unlike many languages, they can be of unlimited size (constrained only by memory size) and can hold...
4
by: agent349 | last post by:
First off, I know arrays can't be compared directly (ie: if (arrary1 == array2)). However, I've been trying to compare two arrays using pointers with no success. Basically, I want to take three...
25
by: Rainmaker | last post by:
Hi, Can anyone tell me an efficient algorithm to sort an array of strings? Keep in mind that this array is HUGE and so the algorithm should me efficient enough to deal with it. Thanks
6
by: Broeisi | last post by:
Hello, I wrote the tiny progam below just to understand arrays and strings better. I have 2 questions about arrays and strings in C. 1. Why is it that when you want to assign a string to an...
2
by: Potiuper | last post by:
Question: Is it possible to use a char pointer array ( char *<name> ) to read an array of strings from a file in C? Given: code is written in ANSI C; I know the exact nature of the strings to be...
19
by: pkirk25 | last post by:
I wonder if anyone has time to write a small example program based on this data or to critique my own effort? A file called Realm List.html contains the following data: Bladefist-Horde...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.