Quzah covered the variable declaration and the typedef pretty well. I'll get to the prototype in a minute, but a huge part is simply because it was designed that way. Like Quzah said, it could've been the other way, but it isn't.
Your syntax is slightly off. There shouldn't be a comma there, which might be part of your association issues. And yes, it is before a type, but it's not before the type it's connected to. It actually is after the type, it's just after the old type name, not the new one. The correct syntax is:
Code:
typedef old type specifier new_type_name;
You care to explain the above to me? The syntax I posted was correct as well. The example I used is a 100% valid C typedef. There "shouldn't be?" I ought to go on the same flame-fest you did about how you should write the ISO committee or quit using C.
Note that I left old type specifier with spaces to show you can have a multi-word type specifier, such as "struct foo_s", but the new_type_name must be a valid C identifier, like "foo_t". What you're really saying with the typedef is (pay attention to the colors):
Code:
typedef char * pchar;
Yeah, that * stays on the left. The old type is a char pointer, or char *. The new name you want as a short hand is pchar. If you put it to the right of pchar, it just wouldn't make sense. Now, continuing on with pchar, we know that:
Code:
int x, y;
// is the same as
int x;
int y;
similarly:
Code:
pchar s, t;
// is the same as
pchar s;
pchar t;
So both s and t are of type pchar. That's the way the language was designed.