-2
I am having the following error in row 13 column 39:
[Error] invalid conversion from 'char' to 'char*' [-fpermissive]
It’s for a college job, I can’t fix the mistake in any way, someone knows what to do?
#include <string.h>
#include <iostream>
using namespace std;
char conc(char *, char *);
int main (void)
{
char nome1[30] = "Matheus ";
char nome2[30] = "Fidelis";
char *nomecompleto = conc(nome1,nome2);
cout << *nomecompleto;
}
char conc(char *s1, char *s2)
{
char *s = new char[strlen(s1)+strlen(s2)+1];
char *aux = s;
while(*s1)
{
*aux = *s1;
aux++;
s1++;
}
while(*s2)
{
*aux = *s2;
aux++;
s2++;
}
*aux = '\0';
return *s;
}