I want to write a code that sort a cstring and put all the correct character into a new cstring,
Here is my Code.
#include<iostream>
#include<cstring>
#include<cctype>
using namespace std;
int main()
{
char array[200]={"How Are U?"};
char array1[200];
int n=0;
for(int i=0;array[i]!='\0';i++)
{
if(islower(array[i])||array[i]==' ')
{
strcpy(array1[n],array[i]);
n++;
}
}
}
but I get this when I try to compile
“invalid conversion from 'char' to 'char*'”
What should i do to make this right? Thanks!