Re: Two Questions about "strlen", "strcat" and "strcpy"
From: jacob navia (jacob_at_jacob.remcomp.fr)
Date: 08/30/04
- Next message: Roopa: "make"
- Previous message: James Kuyper: "Re: addresses and integers"
- In reply to: Paul Hsieh: "Re: Two Questions about "strlen", "strcat" and "strcpy""
- Next in thread: CBFalconer: "Re: Two Questions about "strlen", "strcat" and "strcpy""
- Reply: CBFalconer: "Re: Two Questions about "strlen", "strcat" and "strcpy""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 30 Aug 2004 15:23:57 +0200 To: Paul Hsieh <qed@pobox.com>
Paul Hsieh wrote:
> People who have seen me post here before already know the punchline.
> I've written a string library that does precisely this sort of thing
> (as well as all sorts of other things related to speed, safety,
> functionality and maintainability). You can learn more by visiting
> the second link below.
>
> --
> Paul Hsieh
> http://www.pobox.com/~qed/
> http://bstring.sf.net/
The approach you take is the good one. Length delimited strings!
The string library lcc-win32 proposes is the same idea but with some
syntatic sugar around it:
1) You can index Strings like char *:
String S1 = "abc";
S1[1] // yields 'b'
S1[1] = 'X' // String is now "aXc"
2) You can assign them to local variables in the normal way as shown above
3) All strings are garbage collected. No more "free" problems.
4) Function names are cloned from the C library:
Strcpy
Strcat
etc
Easy to use, easy to learn.
Lcc-win32:
http://www.cs.virginia.edu/~lcc-win32
jacob
- Next message: Roopa: "make"
- Previous message: James Kuyper: "Re: addresses and integers"
- In reply to: Paul Hsieh: "Re: Two Questions about "strlen", "strcat" and "strcpy""
- Next in thread: CBFalconer: "Re: Two Questions about "strlen", "strcat" and "strcpy""
- Reply: CBFalconer: "Re: Two Questions about "strlen", "strcat" and "strcpy""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|