Allow us to remind you that first_screen is a function, and must be called with arguments and a call operator (). You would probably also do well to remember the return in main, and convert that first semicolon on line 8 to a comma.
Then reindent the function and come back to us. (Seriously though, I don't think I can see anything wrong with the function, I'd just stop stacking multiple statments up onto one line.)
EDIT: OK, some quick review revealed another error on line 25. I'm sure you can figure it out. (It's when statements get clumped up like this that that happens.)
Line 14's error I addressed in my last post.
And you cannot switch on a function. A function is not a variable or expression; you cannot define a switch to go around it.
What are you trying to do anyway? That will help you determine what you should be doing in the function.
First things first as stated above you should try to place everything in separate lines so your code is easier to read. However you have 3 mistakes.
If you look at your code this line is incorrect:
char name; password;
You can not have the ; after a type declaration and have the next variable name be associated with that type variable. The line needs to be
char name, password; will work however much nicer to do this
Next minor problem is the fact you didn't close out your function after using the switch statement. You closed the switch statement but never closed the function therefore the compiler has no clue as to when the function first screen ends.
Your next error is both logic error and syntax error in your switch statement. Your switch statement reads switch(first_screen) which is ok if first_screen returned some type of simple variable type however first screen is a void function thus returns nothing. Depending on what your want your switch statement (which appears to want a char value).
Look at those and then ask again if you need more info on what your doing wrong.
@jshafferman, the function does have a complete set of curly brackets. The indenting is just really bad. And the switch would still be wrong if firstscreen had a return - firstly because the recursion would be infinite and secondly because you still need to provide a call operator and the required arguments.
@tummychow, whoops I forgot that the infinite recursion would occur in this situation and also the obvious need for the correct call to the function in general but I thought that was already stated earlier but anyhow, yes the correct call with correct arguments is needed for the function to be ran regardless of how you intend to program it.
@snoopy as tummychow stated you must call your function with the correct arguments in your case first_screen(int , int, int) as you have it right now.
No, I'm saying there would be infinite recursion if you called your function in the switch. You probably shouldn't do that anyway. (unless you had good reason but I don't even know what you are trying to do.)
Line 17's error is a result of the semicolon at the end of line 16. When you define a function you do not end its argument list with a semicolon.
I'll be really clear for line 14. I don't want to sound like I'm babying anybody though something but... you asked. When you refer to a function, you must include the call operator thereafter:
1 2 3 4 5
foo(); // The bold part is the call operator
Even if you have no arguments you must put the call operator there, otherwise you are not calling a function and will probably collide headfirst into an error.
If you have arguments you must include those as well:
1 2 3 4 5
void foo(int, char);
foo(3, 'c'); // The bold part is the call operator
So when you refer to firstscreen, since it is a function you must *call* it.
Code tags not output tags.
Not bad. If that's what the OP actually wanted then it should work fine.
(Although there's no reason for any of those variables to be global actually. The password and name are not referred to in main so they can be declared in the function, and choice can be declared in main and is passed, so no need for that to be global either. I personally avoid using globals if I can.)
(And lastly, you can and should probably replace those char with strings. More effective and reliable.)