i have 2 doubts in this lecture.
for the following code it is showing output as p²a but the output should be p only. why is it so??
char c[10][10];
c[0][0] = ‘p’;
cout<<c[0]<<endl;
when i use cin.get() in place of cin to input a row of 2 D array then it shows error why??
this is the code-
#include
using namespace std;
int main()
{
char a[100][100];
a[0] = cin.get();
a[1] = cin.get();
cout<<a[0]<<endl;
cout<<a[1]<<endl;
return 0;
}
but it works fine when i use cin>>a[0];