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);
- //con este código NO muestra la concatenación, como si no hubiera ocurrido:
- cout << "concatenado: " << e << endl;
- 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++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement