0

ac and av are passed as argument to main function sometimes instead of argc and *argv[].

Do they do the same thing?

tadman
  • 208,517
  • 23
  • 234
  • 262

3 Answers3

1

The names don't matter, the compiler does not care what they are. The only concern is the typing.

You can call them whatever you want, so long as the types match. Note char** v and char* v[] are equivalent to the compiler.

The convention is argc and argv which helps your code be more readable and consistent. Unless you have a very compelling reason, stick with that.

tadman
  • 208,517
  • 23
  • 234
  • 262
0

Yes; the parameter names of main() don't matter.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
HolyBlackCat
  • 78,603
  • 9
  • 131
  • 207
0

Yes, it's just parameter name, you can name them how you want.

But for the main function, I would rather stick to standard naming (argc, argv) rather than ac / av.

Tom's
  • 2,448
  • 10
  • 22