#include <windows.h>
#include <iostream>
usingnamespace std;
int main()
{
char name[50];
cout << "Before continuing tell me your name:";
cin >> name;
cout << "Hello " << name << endl;
}
int world_Builder()
{
char spawn[50];
char answerOne[50];
cout << "This is the world builder here you can \n"
<< "design where you want to spawn and the \n"
<< "vegetation and mineral occypancy of your world!\n"
<<endl;
cout << "Choose in what biome do you want to spawn in: \n"
<< "Forest\n"
<< "Plains\n"
<< "Desert (hardest one)"
<<endl;
cout << "What biome do you start in?";
cin >> spawn;
cout << "Are you sure you want to spawn in? " << spawn << endl;
cin >> answerOne;
if (answerOne = "yes");
{
cout << "Your spawn biome will be " << spawn << endl;
}
}
Ps. i'm using Dev-C++ 5.7.0 as a coding interface if that helps.
Anyway, your code does not depend on windows.h, so you should not include it.
Having changed that, an online compiler says:
In function 'int world_Builder()':
37:20: error: incompatible types in assignment of 'const char [4]' to 'char [50]'
41:1: warning: no return statement in function returning non-void [-Wreturn-type]
Line 37 has syntax error, because you probably made a typo: assignment (=) instead of equality comparison (==). However, equality of pointers is not what you need there. C-string comparison requires a string comparison function from header <cstring>.
Overall, your main() does not call function world_Builder (and it could not if it tried, because it doesn't even know about that function, see function declarations). As such, all the code of your program is now on lines 7-15.
Yes the error IS "recipe for target 'Gamestart.o' failed"
so is there a way to fix that and how should the code be for functions to work do i just need to change the places of "main()" and "world_Builder()"?
Yes the error IS "recipe for target 'Gamestart.o' failed"
This means that the compiler was unable to create the 'Gamestart.o' file (which is a target in the generated make file.) Was this message preceded by other error messages?