Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <locale>
- #include<string.h>
- using namespace std;
- void concatenar(char dest[], char orig[]);
- int main(void)
- {
- setlocale(LC_ALL, "Spanish");
- char e[50]="buen dia", f[9]="como va?";
- concatenar(e, f);
- return 0;
- }
- void concatenar(char dest[], char orig[]){
- int i=0, j=0, x=0;
- while(dest[i]!='\0'){
- i++;
- }
- while(orig[j]!='\0'){
- i++;
- *(dest+i) = *(orig+j);
- j++;
- }
- //con este codigo SI, muestra la concatenacion:
- for(int x=0; x<i; x++){
- cout << *(dest+x);
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement