When using C-style strings you can't use the == or = operators for comparison and assignment. You must use strcmp and strcpy in the <string.h> (or <cstring> for Standard C++) header. Also, there's no need to return anything from check because 1) name is global, 2) You can't assign to it anyway and 3) Arrays are passed by simulated reference so any changes made will be mirrored in main. I think you want something more like this:
Code:
#include <iostream>
#include <cstring>
using namespace std;
void check(char* name_check)
{
if(strcmp(name_check, "Stinky") == 0)
{
strcpy(name_check, "Ryan");
}
else
{
strcpy(name_check, "Not Ryan");
}
}
int main()
{
char name[10];
cout<<"Enter your name: ";
cin.getline(name, 10);
check(name);
cout<<name<<endl;
return 0;
}
I'll address your errors now.
>! Error E2034 .\test.cpp 19: Cannot convert 'char *' to 'char' in function * check(char *)
Your check returns a char * (name_check), but the return type is char. This is a type mismatch. If you really want to return name_check then you need to change the return type to char *.
>! Error E2277 .\test.cpp 26: Lvalue required in function main()
Arrays aren't modifiable lvalues. In other words, you can't assign to an array as a whole.