concatenate « string « C Array Q&A

Home
C Array Q&A
1.bit
2.Byte
3.char
4.class
5.Development
6.Dimensional Array
7.dynamic
8.element
9.find
10.index
11.initialization
12.Integer
13.length
14.loop
15.memory
16.Operation
17.pointer
18.Print
19.size
20.Sort Search
21.string
22.struct
23.variable
C Array Q&A » string » concatenate 

1. concatenate char array in C    stackoverflow.com

I have a a char array:

char* name = "hello";
I want to add an extension to that name to make it
hello.txt
How can I do this? name += ".txt" won't work

2. Concatenate two char arrays?    stackoverflow.com

If I have two char arrays like so:

char one[200];
char two[200];
And I then want to make a third which concatenates these how could I do it? I have tried:
char three[400];
strcpy(three, one);
strcat(three, two);
But this ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.