There is also a problem with how you use strcat. This function "appends" the second argument (tab) to the first (outname) modifying outname. But since outname is a pointer to a const string, there is no room to do the concatenation. You also call strcat twice, so tab is appended twice.
Anyone have any ideas why when using strcat function I would get some garbage at the beginning of the output string? what I'm doing is something like the following example.
Code:
char temp;
char tempHolder;
for(int i=0;i<something;i++){
sprintf(temp,"%u ", someVariable);... (2 Replies)
Hi all,
How does string concatenation work in shell scripting?
I basically have a variable called "string" and I want to add the strings "aaa" "bbb" "ccc" "ddd" to the variable "string". These strings would be added based on some conditions and separated by spaces . So "string" might look... (8 Replies)
A question to ask.
seq1 = "eeeeeeeeeeeeeeeeee";
seq2 = "dddddddddddddddddddd";
char a = '*';
strcat(*seq2, &a);
strcat(*seq1, seq2);
compilation
warning: passing arg 1 of `strcat' makes pointer from integer without a cast
thanks (4 Replies)