View Single Post
  #4  
Old 14-10-2008, 01:22 AM
.BZU.'s Avatar
.BZU. .BZU. is offline


 
Join Date: Sep 2007
Location: near Govt College of Science Multan Pakistan
Posts: 9,693
Contact Number: Removed
Program / Discipline: BSIT
Class Roll Number: 07-15
.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute.BZU. has a reputation beyond repute
Default Re: Copy elements of Two arrays to another ONE in C++

Whats about the 0 indexed element of second array i.e. 6 not showing... Ah..
By the way function is write...
Mam was satisfied... LOL
Code:
#include <iostream>
using namespace std;

void main()
{
    int n=10;
    char myarray1[5]={'1','2','3','4','5'};
    char myarray2[5]={'6','7','8','9','0'};
    char myarray3[10];

    for(int i=0;i<=n;i++)
    {
        if(i<=5)
        {
            myarray3[i]=myarray1[i];
        }
        else
        {
            myarray3[i]=myarray2[i-5];
        }
    }

for (int j=0;j<=9;j++)
    cout<<myarray3[j]; 
}

Attached Images
 
__________________
(¯`v´¯)
`*.¸.*`

¸.*´¸.*´¨) ¸.*´¨)
(¸.*´ (¸.
Bzu Forum

Don't cry because it's over, smile because it happened
Reply With Quote