0

Why is the variable "char *s" declared in between the function name and curly braces? What is the significance of it?

 main(m1,s) char *s; {
     /*
       some code here
     */
}
user2749142
  • 31
  • 1
  • 7

1 Answers1

0

This is old K&R C syntax (pre-dates ANSI/ISO C). Nowadays, you should not use it anymore (as you have already noticed its major disadvantage: the compiler won't check the types of arguments for you).

 main(m1,s) char *s; {
     /*
       some code here
     */
}

in this code compiler did not check data type of m1 and s.

Sumit Gemini
  • 1,836
  • 1
  • 15
  • 19