One liners for converting non-nullterminated arrays to string

  • Follow


I'd be interested in suggestions for one liners for converting two non-
nullterminated byte arrays such as "abc   " and "def    " (note that
both may or may not have a couple of trailing blanks) into a
nullterminated string where trailing blanks are removed, i.e. "abc/
def".

Thank you.
0
Reply helmuterik 11/11/2010 10:31:35 PM

On 11 Nov, 23:31, helmuterik <kkin...@msn.com> wrote:
> I'd be interested in suggestions for one liners for converting two non-
> nullterminated byte arrays such as "abc =A0 " and "def =A0 =A0" (note tha=
t
> both may or may not have a couple of trailing blanks) into a
> nullterminated string where trailing blanks are removed, i.e. "abc/
> def".
>
> Thank you.

The result should be "abc/def", no blank in there whatsoever. Sorry
for the typo.
0
Reply helmuterik 11/11/2010 10:32:59 PM


On 2010-11-11, helmuterik <kkinski@msn.com> wrote:
> I'd be interested in suggestions for one liners

Why should this be a one liner?

> for converting two non-
> nullterminated byte arrays such as "abc   " and "def    " (note that
> both may or may not have a couple of trailing blanks) into a
> nullterminated string where trailing blanks are removed, i.e. "abc/
> def".

Underspecified.  Can the byte arrays contain internal spaces which are
not trailing spaces?  If so, what do we do about those?  Do you know the sizes
of these arrays?

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
0
Reply Seebs 11/11/2010 11:30:49 PM


"helmuterik" <kkinski@msn.com> wrote in message 
news:6d3750fe-67b2-40db-996b-5ef02b5337c7@o23g2000prh.googlegroups.com...
> I'd be interested in suggestions for one liners for converting two non-
> nullterminated byte arrays such as "abc   " and "def    " (note that
> both may or may not have a couple of trailing blanks) into a
> nullterminated string where trailing blanks are removed, i.e. "abc/
> def".

The one-liner has to do the roughly the equivalent of joinstrings() in the 
following code. Good luck with squeezing that into one line, especially if 
it needs to worry about managing memory too.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int joinstrings(char* s, int slen, char* t, int tlen, char* dest){

while (slen && s[slen-1]==' ') --slen;
while (tlen && t[tlen-1]==' ') --tlen;

memcpy(dest,s,slen);
dest[slen]='/';
memcpy(dest+slen+1,t,tlen);
dest[slen+tlen+1]=0;

return slen+tlen+1;
}

int main(void){
char s[1000];

joinstrings("abc  ",5,"def  ",5,s);

printf("<%s>\n",s);
}

-- 
Bartc
 

0
Reply BartC 11/11/2010 11:35:29 PM

On Nov 11, 4:31=A0pm, helmuterik <kkin...@msn.com> wrote:
> I'd be interested in suggestions for one liners for converting two non-
> nullterminated byte arrays such as "abc =A0 " and "def =A0 =A0" (note tha=
t
> both may or may not have a couple of trailing blanks) into a
> nullterminated string where trailing blanks are removed, i.e. "abc/
> def".
>
> Thank you.

To make it a one-liner, remove all newlines.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
    char a[3] =3D "abc";
    size_t an =3D sizeof(a);
    char b[3] =3D "def";
    size_t bn =3D sizeof(b);

    char *c;
    c =3D malloc(an+1+bn+1);
    memcpy(c,a,an);
    c[an] =3D '/';
    memcpy(c+1+an,b,bn);
    c[an+1+bn] =3D '\0';
    puts(c);
}
0
Reply luser 11/12/2010 7:54:02 AM

On 12 Nov, 00:30, Seebs <usenet-nos...@seebs.net> wrote:

>
> Why should this be a one liner?

I am just curious.

> Underspecified. =A0Can the byte arrays contain internal spaces which are
> not trailing spaces? =A0If so, what do we do about those? =A0Do you know =
the sizes
> of these arrays?

True! No internal spaces allowed and they're both 10 bytes long, fixed
length. It's from a mainframe type environment.
0
Reply helmuterik 11/12/2010 9:44:09 AM

"Seebs" <usenet-nospam@seebs.net> wrote in message 
news:slrnidovcq.2j9m.usenet-nospam@guild.seebs.net...
> On 2010-11-11, helmuterik <kkinski@msn.com> wrote:

>> for converting two non-
>> nullterminated byte arrays such as "abc   " and "def    " (note that
>> both may or may not have a couple of trailing blanks) into a
>> nullterminated string where trailing blanks are removed, i.e. "abc/
>> def".
>
> Underspecified.  Can the byte arrays contain internal spaces which are
> not trailing spaces?

I don't agree. The problem only mentions trailing blanks, suggesting that 
leading or embedded blanks are ignored. (Although what 'blanks' are could do 
with clarifying.)

>  If so, what do we do about those?  Do you know the sizes
> of these arrays?

If they are not nul-terminated, we have to assume that the sizes are known 
by some other method.

-- 
Bartc 

0
Reply BartC 11/12/2010 10:39:57 AM

helmuterik <kkinski@msn.com> writes:

> On 12 Nov, 00:30, Seebs <usenet-nos...@seebs.net> wrote:
>
>>
>> Why should this be a one liner?
>
> I am just curious.
>
>> Underspecified.  Can the byte arrays contain internal spaces which are
>> not trailing spaces?  If so, what do we do about those?  Do you know the sizes
>> of these arrays?
>
> True! No internal spaces allowed and they're both 10 bytes long, fixed
> length. It's from a mainframe type environment.

I was going to post the following as a solution, but a quick check
reveals that it's undefined (assume the byte arrays are in 'a' and 'b'):

  int n;
  sscanf(a, "%10[^ ]%n", res, &n);
  res[n] = '/';
  sscanf(b, "%10[^ ]", res + n + 1);

It's undefined because sscanf's first argument must be a string and your
non null-terminated arrays are not strings.

Apart from that (Mrs Lincoln) It would be a nice solution because sscanf
can limit the length of copying, stop on a space, and report the copied
length all in one call.

-- 
Ben.
0
Reply Ben 11/12/2010 11:21:20 AM

On Nov 11, 5:32=A0pm, helmuterik <kkin...@msn.com> wrote:
> On 11 Nov, 23:31, helmuterik <kkin...@msn.com> wrote:
>
> > I'd be interested in suggestions for one liners for converting two non-
> > nullterminated byte arrays such as "abc =A0 " and "def =A0 =A0" (note t=
hat
> > both may or may not have a couple of trailing blanks) into a
> > nullterminated string where trailing blanks are removed, i.e. "abc/
> > def".
>
> > Thank you.
>
> The result should be "abc/def", no blank in there whatsoever. Sorry
> for the typo.

Not code I'd recommend for a variety of reasons.  It does assume at
least one trailing blank, as I don't see how given the info provided
this can work (if it is not nul terminated and doesn't have any
blanks, how do you know where it ends?).  Does all the actual work in
one awful line...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void)
{
    char abc[6] =3D "abc   "; /* not nul terminated */
    char def[6] =3D "def   "; /* not nul terminated */
    char *result =3D strncat(strncat( calloc(strcspn(abc, " ")
+strcspn(def, " ")+1,1), abc, strcspn(abc," ")), def, strcspn(def,"
"));

    printf("%s\n", result);

    free(result);

    return 0;
}
0
Reply David 11/12/2010 2:17:01 PM

On Nov 12, 9:17=A0am, David Resnick <lndresn...@gmail.com> wrote:
> On Nov 11, 5:32=A0pm, helmuterik <kkin...@msn.com> wrote:
>
> > On 11 Nov, 23:31, helmuterik <kkin...@msn.com> wrote:
>
> > > I'd be interested in suggestions for one liners for converting two no=
n-
> > > nullterminated byte arrays such as "abc =A0 " and "def =A0 =A0" (note=
 that
> > > both may or may not have a couple of trailing blanks) into a
> > > nullterminated string where trailing blanks are removed, i.e. "abc/
> > > def".
>
> > > Thank you.
>
> > The result should be "abc/def", no blank in there whatsoever. Sorry
> > for the typo.
>
> Not code I'd recommend for a variety of reasons. =A0It does assume at
> least one trailing blank, as I don't see how given the info provided
> this can work (if it is not nul terminated and doesn't have any
> blanks, how do you know where it ends?). =A0Does all the actual work in
> one awful line...
>

AH, I see downthread max length of 10.  Still one liner below if you
assume macro doesn't count, could substitute it manually if you REALLY
want to.  Even more awful...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define MAX 10
#define LEN(field) ( memchr((field),' ',MAX ) =3D=3D NULL ? MAX :
(  (char*)memchr((field),' ',MAX ) - (char*)(&(field)[0])) )

int main(void)
{

    char abc[MAX] =3D "abc       "; /* not nul terminated */
    char def[MAX] =3D "def       "; /* not nul terminated */

    char *result =3D strncat(strncat( calloc(LEN(abc)+LEN(def)+1,1),
abc, LEN(abc)), def, LEN(def));

    printf("%s\n", result);

    free(result);

    return 0;
}

0
Reply David 11/12/2010 2:33:32 PM

On Nov 12, 9:33=A0am, David Resnick <lndresn...@gmail.com> wrote:
> On Nov 12, 9:17=A0am, David Resnick <lndresn...@gmail.com> wrote:
>
>
>
> > On Nov 11, 5:32=A0pm, helmuterik <kkin...@msn.com> wrote:
>
> > > On 11 Nov, 23:31, helmuterik <kkin...@msn.com> wrote:
>
> > > > I'd be interested in suggestions for one liners for converting two =
non-
> > > > nullterminated byte arrays such as "abc =A0 " and "def =A0 =A0" (no=
te that
> > > > both may or may not have a couple of trailing blanks) into a
> > > > nullterminated string where trailing blanks are removed, i.e. "abc/
> > > > def".
>
> > > > Thank you.
>
> > > The result should be "abc/def", no blank in there whatsoever. Sorry
> > > for the typo.
>
> > Not code I'd recommend for a variety of reasons. =A0It does assume at
> > least one trailing blank, as I don't see how given the info provided
> > this can work (if it is not nul terminated and doesn't have any
> > blanks, how do you know where it ends?). =A0Does all the actual work in
> > one awful line...
>
> AH, I see downthread max length of 10. =A0Still one liner below if you
> assume macro doesn't count, could substitute it manually if you REALLY
> want to. =A0Even more awful...
>

Reading more carefully, this sneaks in the "/" too.  Mind you, anyone
putting this code into actual use should be shot, though if you
replace calloc with some "safe_calloc" variant that doesn't return on
failure it would actually work fine I believe.

    char *result =3D strncat(strcat(strncat( calloc(LEN(abc)+LEN(def)
+2,1), abc, LEN(abc)), "/"), def, LEN(def));

-David


0
Reply David 11/12/2010 2:37:46 PM

> Reading more carefully, this sneaks in the "/" too. =A0Mind you, anyone
> putting this code into actual use should be shot, though if you
> replace calloc with some "safe_calloc" variant that doesn't return on
> failure it would actually work fine I believe.
>

Thanks David! Now I can stick with a non-one-liner solution and feel
good about it.


0
Reply helmuterik 11/12/2010 3:09:41 PM

helmuterik <kkinski@msn.com> writes:
> On 12 Nov, 00:30, Seebs <usenet-nos...@seebs.net> wrote:
>> Why should this be a one liner?
>
> I am just curious.

There are more interesting things to be curious about.  There's no
benefit to doing this in one line of code.

>> Underspecified.  Can the byte arrays contain internal spaces which
>> are not trailing spaces?  If so, what do we do about those?  Do you
>> know the sizes of these arrays?
>
> True! No internal spaces allowed and they're both 10 bytes long, fixed
> length. It's from a mainframe type environment.

What exactly does "No internal spaces allowed" mean?  If there are
internal spaces, is that reported as an error (and if so, how)?
Or is the code just allowed to assume that there are no internal
spaces, and you don't care what happens if there are?

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
0
Reply Keith 11/12/2010 4:16:04 PM

On 12 Nov, 17:17, Keith Thompson <ks...@mib.org> wrote:



> What exactly does "No internal spaces allowed" mean? =A0If there are
> internal spaces, is that reported as an error (and if so, how)?
> Or is the code just allowed to assume that there are no internal
> spaces, and you don't care what happens if there are?

It means that in my particular environment the array holds the name of
an object whose name cannot contain spaces. That is, you can't create
objects violating this naming rule.

0
Reply helmuterik 11/12/2010 4:25:07 PM

"BartC" <bc@freeuk.com> wrote in message 
news:ibhuor$10p$1@news.eternal-september.org...

> "helmuterik" <kkinski@msn.com> wrote in message 
> news:6d3750fe-67b2-40db-996b-5ef02b5337c7@o23g2000prh.googlegroups.com...
>> I'd be interested in suggestions for one liners for converting two non-
>> nullterminated byte arrays such as "abc   " and "def    " (note that
>> both may or may not have a couple of trailing blanks) into a
>> nullterminated string where trailing blanks are removed, i.e. "abc/
>> def".
>
> The one-liner has to do the roughly the equivalent of joinstrings() in the

BTW, if you want a real one-line answer, try a different language. Then it 
might look like:

  trim(a)+"/"+trim(b)

and not even take a whole line to itself. But if you want control over 
exactly how it works, and or need to execute it billions of times, then be 
prepared to invest a few extra lines when using C (lines don't cost much).

-- 
Bartc 

0
Reply BartC 11/12/2010 4:48:45 PM

helmuterik <kkinski@msn.com> writes:
> On 12 Nov, 17:17, Keith Thompson <ks...@mib.org> wrote:
>> What exactly does "No internal spaces allowed" mean?  If there are
>> internal spaces, is that reported as an error (and if so, how)?
>> Or is the code just allowed to assume that there are no internal
>> spaces, and you don't care what happens if there are?
>
> It means that in my particular environment the array holds the name of
> an object whose name cannot contain spaces. That is, you can't create
> objects violating this naming rule.

Which means that the code can safely assume that there are no
internal spaces, and you don't care what it does if it's given
a name that does contain internal spaces?

To be clear, I'm not saying that you *should* care, just that if
you don't you should clearly document that fact.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
0
Reply Keith 11/12/2010 6:36:05 PM

On 2010-11-12, helmuterik <kkinski@msn.com> wrote:
> On 12 Nov, 00:30, Seebs <usenet-nos...@seebs.net> wrote:
>> Why should this be a one liner?

> I am just curious.

I guess, I have no interest in trying to make things into one-liners
these days.  You probably could, but it seems pointless.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
0
Reply Seebs 11/12/2010 7:22:10 PM

Seebs <usenet-nospam@seebs.net> writes:
> On 2010-11-12, helmuterik <kkinski@msn.com> wrote:
>> On 12 Nov, 00:30, Seebs <usenet-nos...@seebs.net> wrote:
>>> Why should this be a one liner?
>
>> I am just curious.
>
> I guess, I have no interest in trying to make things into one-liners
> these days.  You probably could, but it seems pointless.

One-liners can be quite useful for interpretive languages where
you can interactively type something in a shell command line (or
whatever your system's equivalent is).  Awk and Perl are both good
for this kind of thing.

For compiled languages like C, where programs are in text files,
there's no particular advantage in one-liners (unless you're trying
to show off how terse you can be).

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
0
Reply Keith 11/12/2010 8:57:04 PM

In article <ln62w25kfa.fsf@nuthaus.mib.org>,
Keith Thompson  <kst-u@mib.org> wrote:
....
>For compiled languages like C, where programs are in text files,
>there's no particular advantage in one-liners (unless you're trying
>to show off how terse you can be).

Suppose a pretty girl offers to have sex with you if you can do it in
one line?

Suppose a rich man offers you a dream job if you can do it in
one line?

Somehow, I doubt either one of these (certainly not the first) would
sway either Seebs or Kiki...

-- 
Is God willing to prevent evil, but not able? Then he is not omnipotent.
Is he able, but not willing? Then he is malevolent.
Is he both able and willing? Then whence cometh evil?
Is he neither able nor willing? Then why call him God?
~ Epicurus

0
Reply gazelle 11/12/2010 10:10:46 PM

On Nov 12, 4:10=A0pm, gaze...@shell.xmission.com (Kenny McCormack)
wrote:
> In article <ln62w25kfa....@nuthaus.mib.org>,
> Keith Thompson =A0<ks...@mib.org> wrote:
> ...
>
> >For compiled languages like C, where programs are in text files,
> >there's no particular advantage in one-liners (unless you're trying
> >to show off how terse you can be).
>
> Suppose a pretty girl offers to have sex with you if you can do it in
> one line?
>
> Suppose a rich man offers you a dream job if you can do it in
> one line?
>
> Somehow, I doubt either one of these (certainly not the first) would
> sway either Seebs or Kiki...
>

Dude, why are you always such a dick?


0
Reply luser 11/13/2010 6:20:41 AM

I got this one to work:

#include <stdlib.h>
#include <stdio.h>

int main(void) {
  char bytearray[10] = "f         ";
  char string[100];

  snprintf(string, sizeof(string)-1, "%.*s/%.*s",
  ( (char *) memchr(bytearray, ' ', 10) == NULL ? 10 : (( (char *)
memchr(bytearray, ' ', 10)) - bytearray)),
  bytearray,
  ( (char *) memchr(bytearray, ' ', 10) == NULL ? 10 : (( (char *)
memchr(bytearray, ' ', 10)) - bytearray)),
  bytearray);

  printf("%s\n", string);
  return 0;
}

Not that I will use it in production though.

0
Reply helmuterik 11/13/2010 2:37:28 PM

helmuterik <kkinski@msn.com> writes:

> I'd be interested in suggestions for one liners for converting two non-
> nullterminated byte arrays such as "abc   " and "def    " (note that
> both may or may not have a couple of trailing blanks) into a
> nullterminated string where trailing blanks are removed, i.e. "abc/
> def".
>
> [noted later that the two arrays have at most 10 characters each]
> [noted also that the two arrays have no internal blanks]

Given function parameters

  char out[static 23], const char a[static 10], const char b[static 10]

it could be done by this one-line expression:

  strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
    out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
  );

with the result being in 'out'.

Of course, I never would have considered writing it this
way had it not been for the posting/request.  Still it's
kind of interesting -- I wouldn't have guessed that the
str{cpy,chr,cat,ncpy} functions together (and using no
other functions) had this much power.
0
Reply Tim 11/13/2010 7:53:09 PM

Tim Rentsch <txr@alumni.caltech.edu> writes:
>it could be done by this one-line expression:
>  strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>    out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>  );
 
  This (

strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
  out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
);


  ) is a statement.
 
0
Reply ram 11/13/2010 8:04:19 PM

On 11/13/2010 15:04, Stefan Ram wrote:
> Tim Rentsch<txr@alumni.caltech.edu>  writes:
>> it could be done by this one-line expression:
>>   strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>>     out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>>   );
>
>    This (
>
> strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>    out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
> );
>
>
>    ) is a statement.
>
Yes, it is. You can always tell a statement by the trailing semicolon.

-- 
Joe Wright
"If you rob Peter to pay Paul you can depend on the support of Paul."
0
Reply Joe 11/13/2010 8:36:14 PM

ram@zedat.fu-berlin.de (Stefan Ram) writes:

> Tim Rentsch <txr@alumni.caltech.edu> writes:
>>it could be done by this one-line expression:
>>  strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>>    out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>>  );
>  
>   This (
>
> strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>   out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
> );
>
>
>   ) is a statement.

That's right.  Those lines of my posting have the
aforementioned one-line expression, /and/ also
supplied at no additional cost the semicolon that
together with the expression makes a statement.
0
Reply Tim 11/13/2010 8:46:57 PM

Joe Wright <joewwright@comcast.net> writes:

> On 11/13/2010 15:04, Stefan Ram wrote:
>> Tim Rentsch<txr@alumni.caltech.edu>  writes:
>>> it could be done by this one-line expression:
>>>   strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>>>     out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>>>   );
>>
>>    This (
>>
>> strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>>    out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>> );

(very nice, by the way)

>>    ) is a statement.
>>
> Yes, it is. You can always tell a statement by the trailing semicolon.

That's a challenge, isn't it?  This is a statement with no trailing
semicolon:

  if (x) {} else {}

and this has a trailing semicolon but is not a statement:

  int x = 1;

-- 
Ben.
0
Reply Ben 11/13/2010 11:13:03 PM

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>That's a challenge, isn't it?  This is a statement with no trailing
>semicolon:
>if (x) {} else {}

  Yes. And

{}

  would already suffice alone (as a statement not
  ending with a semicolon).

>and this has a trailing semicolon but is not a statement:
>int x = 1;

  Yes. And it is a block-item, just as a statement also is
  a block-item.

0
Reply ram 11/13/2010 11:30:05 PM

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Joe Wright <joewwright@comcast.net> writes:
>
>> On 11/13/2010 15:04, Stefan Ram wrote:
>>> Tim Rentsch<txr@alumni.caltech.edu>  writes:
>>>> it could be done by this one-line expression:
>>>>   strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>>>>     out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>>>>   );
>>>
>>>    This (
>>>
>>> strcpy( strchr( strcat( strncpy( strcpy( strchr( strcat( strncpy( strncpy( \
>>>    out, "", 23 ), a, 10 ), " " ), ' ' ), "/" )+1, b, 10 ), " " ), ' ' ), "" \
>>> );
>
> (very nice, by the way)

Thank you sir!  I must admit I was pleased to find
this solution.
0
Reply Tim 11/18/2010 6:13:55 AM

27 Replies
180 Views

(page loaded in 2.959 seconds)


Reply: