用于处理动态内存中的数组的程序。需要C的等价物。有人可以帮忙吗?
const int n = 6;
char **words = (char**) malloc(n *sizeof(char*));
for(int i = 0 ; i < n; i++)
words[i] = (char*)malloc( 50 * sizeof(int));
for(int i = 0; i < n; i++)
{
cin>>words[i];
}
cout<<endl;
for(int i = 0; i < n; i++)
{
if(words[i][0] == 'q')
cout<<words[i]<<endl;
}