Listen people, i want to write a method that gets a line from the user, so i wrote this:
static char* getline(){
char temp[0];
cin >> temp;
return temp;
}
I also have a writeline method:
static void writeline(char* text){
cout<<text<<endl;
}
and then i go to the main and wrote this:
writeline(getline());
and it didnt work.. i want to say that when i wrote this:
static char* getline(){
char temp[0];
cin >> temp;
writeline(getline());
return temp;
}
and i wrote in main this:
getline();
it did work!
so what do i need to do?