how can i add a string to the end of a char array that contains the string "/bin/" if i have another char array in variable b how do i add it to this other char array containging "/bin/"
how can i add a string to the end of a char array that contains the string "/bin/" if i have another char array in variable b how do i add it to this other char array containging "/bin/"
Last edited by weedus; 03-07-2002 at 12:50 AM.
go here
http://www.cprogramming.com/fod/strcat.html
or search...
hoping to be certified (programming in c)
here's the news - I'm officially certified.
i still do not understand how to add a char array to an already existing char array
Well, if you looked at the link, and still can't see how to use strcat() to do what you want, perhaps you're not asking the right question.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
this will printCode:#include <string.h> #include <stdio.h> int main (void) { char string_one[50] = "can you please ", string_two[8] ="help me"; /* string two is appended to string one */ /* make sure string one has enough elements for both strings */ strcat(string_one, string_two); printf(string_one); printf("\n%s", string_two); return 0; }
can you please help me
help me
Last edited by bigtamscot; 03-07-2002 at 07:00 AM.
hoping to be certified (programming in c)
here's the news - I'm officially certified.
thank you