| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Pascal strings |
So to Michael Baker do I speak these words:
Saturday October 16 1993 22:40, Michael Baker wrote to Steven Pasztor:
SP>> I've been thinking along those lines too... Conversion wouldn't really
SP>> be neccisary. Give C routines the string starting at the second
SP>> character, and pascal routines get the string starting from the first.
SP>> (size byte) Then all you have to do is call a routine which
SP>> recalculates the length byte, or replaces the nul depending on wether
SP>> it was altered by a C or Pascal routine. Then all you've got to do is
SP>> remember to hand C routines a string starting at the second character
SP>> instead of the first. That's where the fun starts! :-)
MB> What you describe here is what I had in mind when I said conversion
MB> functions. Something like:
MB> #include
MB> char * P2Cstr(char * str)
MB> {
MB> str[str[0] + 1] = '\0';
MB> return &str[1];
MB> }
MB> char * C2Pstr(char * str)
MB> {
MB> /* this assumes str is a pointer to Pstr[1]
MB> where Pstr is an array of char */
MB> char * Pstr = str - 1;
MB> Pstr[0] = strlen(str);
MB> return Pstr;
MB> }
Hmmm... I'll make sure I try them out...
MB> Beware, I have not tested this.
Cool... Thanks.
nevets
... I'm innocent and haven't been read my rights!
--- FMail 0.94
* Origin: HELP!!! (3:632/103.123)SEEN-BY: 50/99 54/54 99 620/243 622/405 623/630 632/103 301 348 365 386 998 SEEN-BY: 633/371 634/383 384 635/502 503 544 555 570 636/100 670/206 711/401 SEEN-BY: 711/409 430 807 808 809 932 934 712/623 627 713/888 714/906 800/1 @PATH: 632/103 348 635/503 50/99 54/54 99 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.