Q:
C programming for unix/windows.
Hello sir,
Can you tell me how it is possible to truncate the www. from
www.anyname.com and print it on the end of another statement like:
webmaster@"anyname.com goes here.
thank you.
*NAME-DELETED*
A:
In C you can manipulate strings, but you have to allocate memory to store
the strings. The following code fragment may help.
char *s = "www.anyname.com"
char b[100];
while( *s && *s != '.' )s++;
strcpy(b,"webmaster@");
strcat(b,s);
Regards,
Peter
[ back to toc ]