Check if two arrays are permutation of each other or not?

i am trying to sort the arrays and then compare if they are equal or not for this problems , but the approach is giving error

#include
#include
#include

using namespace std;

int main(){

char a[50],b[50];
cin>>a>>b;
int a1=strlen(a),b1=strlen(b);
sort(a,a+a1);sort(b,b+b1);
cout<<a<<"   "<<b<<endl;
cout<<(a==b);



return 0;

}

@pawankhandelwal.10 please share your code through cb ide which is on ide.codingblocks.com

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.