title image


Smiley danke, habs
habe es so hingebastelt mit anderer hiolfe noch:



int splitter (char *in, char *out_left, char *out_right)

{

int colon = 0;

char *left = out_left;

char *right = out_right;

for(;;)

{

char b = *in++;

if (b == 0)

{

*out_left = 0;

*out_right = 0;

break;

}

if (b == ':')

{

colon++;

continue;

}

if (colon)

*out_right++ = b;

else

*out_left++ = b;

}

return colon == 1 && left != out_left && right != out_right;

}



int main()

{

char *in = "hallo:test";

char left[256];

char right[256];

int result = splitter(in, left, right);

printf ("%d %s %s\n", result, left, right);

getchar();

}

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: