main() Q: What’re the right forms of main()? void main() static int main() int main(char** argv, int argc) int main(int argc, char** argv) int main() inline int main(int argc, char* argv[]) int main(char* argv[], int argc) int main(int argc, char* argv[]) int main(int argc, char* argv[], char* options[]) Ans: 5, 8, 9 main() must return an int, and must have either no parameters or (int argc , char* argv[]) as its first set of parameters. A program that declares main() to be inline or static is ill-formed

main()

Q: What’re the right forms of main()?

  1. void main()
  2. static int main()
  3. int main(char** argv, int argc)
  4. int main(int argc, char** argv)
  5. int main()
  6. inline int main(int argc, char* argv[])
  7. int main(char* argv[], int argc)
  8. int main(int argc, char* argv[])
  9. int main(int argc, char* argv[], char* options[])

Ans: 5, 8, 9

main() must return an int, and must have either no parameters or (int argc , char* argv[])as its first set of parameters. A program that declares main() to be inline or static is ill-formed

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s