101

Nov 15, 2009 at 1:42pm
#include<iostream.h>
//#include<string.h>
main()
char f[10];
char s[10];
char m[20];
char c;
cout<<"Please enter the character in the first array:";
for(c=0;c<11;c++)
cin>> a[c];
cout<<"Please enter the character in the second array:";
for(c=0;c<11;c++)
cin>> b[c];
this code not compiling n run
plz highlight my mistake
Nov 15, 2009 at 4:26pm
You should post your errors too. But in this case your syntax is way off. You don't have any braces.
Nov 15, 2009 at 4:38pm
iostream.h is a deprecated header, main() has no return type and no body, cout and cin are not in the global namespace, a and b are not declared.
Nov 15, 2009 at 5:46pm
Sonia,
I dont know exactly what you are trying to achieve, but hope the following code helps you

#include<iostream>
using namespace std;

int main()
{
char a[10];
char b[10];
char c;
cout<<"Please enter the character in the first array:";
for(c=0;c<10;c++)
cin>> a[c];
cout<<"Please enter the character in the second array:";
for(c=0;c<10;c++)
cin>> b[c];

for(int i=0;i<10;i++)
cout << a[i];
cout << b[i];
}
Topic archived. No new replies allowed.