Need Help with error C2660 in code.

I have been at this program for hours trying to fix error C2660 for this basic program. If anyone can help me out it'd be much appreciated.


#include <iostream>
#include <cstring>
using namespace std;
char enter(char n);
void return1();

int main(void)
{
const int size = 14;
char n [size];
enter();
cin >> n;
return1();
cout << n;
system("pause");
return 0;
}
char enter(char n)
{
cout << "Enter Your Name" << endl;
return n;
}
void return1()
{
cout << "Your name is: " << endl;
}
Here is the right program
#include <iostream>
#include <cstring>
using namespace std;

void enter();// here is error
char * return1( char * );//here is error too when char function returns then char function
//always return by pointer and parameter also take the argument by pointer

int main(void)
{
const int size = 14;
char n [size];
enter();
cin >> n;
cout << "the char variable : " << n << endl;
cout << "Function return is below : " << endl;
cout << return1(n) << endl;
system("pause");
return 0;
}

void enter()
{
cout << "Enter your name" << endl;
}

char * return1( char * n )
{
cout << "Your name is: ";
return n;
}
Topic archived. No new replies allowed.