How to Copy an integer array to array of characters(STRING) ?

Hi Everyone...
i want to copy the student[i][j]'s part student[j] to The Entered String named as name[4][100]...
i am getting no idea how to copy this... i tried string's builtin functions but they didn't work with integers.....


#include<iostream>
using namespace std;

void main()
{
int student[2][4];
char name[4][100];
cout<<"Enter Student's Name "<<endl;
for(int i=0;i<4;i++)
{
cin.getline(name[i],100);
}

for(int i=0;i<2;i++)
{
if(i==0)
{cout<<"Enter Roll Number "<<endl;}
if(i==1)
{cout<<"Enter Marks "<<endl;}
for(int j=0;j<4;j++)
{

cin>>student[i][j];
}
}
int max=student[0][0];
int maxx=student[1][0];

for(int i=0;i<2;i++)
{
for(int j=0;j<4;j++)
{
if(max<student[0][j] && maxx<student[1][j])
{
max=student[0][j];
maxx=student[1][j];
}
}
}




cout<<"Max "<<endl<<endl<<max<<"\t"<<maxx<<endl;
system("pause");
}
Last edited on
Topic archived. No new replies allowed.