0

what is this syntax item in C++ and for what it use?

I've just come across this strange C++ syntax:

auto someFunc() -> int{
    int a = 42;
    return a;
}

i cant find in google what is it, so i try ask it here. thanks for answer!

tadman
  • 208,517
  • 23
  • 234
  • 262
  • 1
    Does this answer your question? [Should the trailing return type syntax style become the default for new C++11 programs?](https://stackoverflow.com/questions/11215227/should-the-trailing-return-type-syntax-style-become-the-default-for-new-c11-pr) – Brian61354270 Aug 04 '20 at 19:34
  • 1
    Your modern C++ book should cover this. – Asteroids With Wings Aug 04 '20 at 19:35
  • 3
    Note: This is C++ syntax and has *absolutely nothing* to do with C. There is no such thing as C/C++. – tadman Aug 04 '20 at 19:36

0 Answers0