Need help with the conversion
Code:
#include <iostream>
#include <cstdlib>
using namespace std;
void search(char a,char b[], int size);
int main()
{
int j = 0;
char *a,*b;
int size = 5;
a = new char[size];
b = new char;
int i;
for(int i = 0 ; i < size ; i++)
cin>>a[i];
for( i = 0; i < size; i++)
if(!search(a,b,size)) //This is my main problem of conversion
{
b[j]= a[i];
j++;
}
for(int i= 0; i < j; i++)
cout>>b[i];
cout<<endl;
system("PAUSE");
return 0;
}
void search(char a,char b[], int size)
{
bool found = false;
for(int i = 0 ; i < size ; i++)
if (a == b[i])
found = true;
return found;
}
Here is my code and I need help from the conversion. Even I try to pre-write the code to avoid that mistake but it still appear in another line, and I don't know how to fix this. Any suggestion?????