0

All, Forgive me I am a newbie into the C++ world from C# and Java, I found it is common that underscore is used to prefixed variables or keywords in the C++ code. like function parameter _In and __try . I don't know what is the difference between with and without underscore prefix. Could someone please give me a something to read. thanks.

Best Regards.

Joe.wang
  • 11,537
  • 25
  • 103
  • 180
  • 10
    Neither of those are part of standard C++. They're Microsoft extensions. – chris Sep 04 '13 at 02:25
  • 3
    ... for structured exception handling. (__try) – WhozCraig Sep 04 '13 at 02:26
  • :) +1 thanks, What do they use for? – Joe.wang Sep 04 '13 at 02:27
  • 5
    @joe.wang For `__try` check out [MSDN](http://msdn.microsoft.com/en-us/library/vstudio/swezty51.aspx). The `_In` is a "[SAL annotation](http://msdn.microsoft.com/en-us/library/ms235402.aspx)". These annotations are used by some static analysis tools included with Microsoft compilers to help improve code correctness and detect bugs. – Nik Bougalis Sep 04 '13 at 02:35
  • Duplicate of [c++ try-catch statement vs __try/__except](http://stackoverflow.com/questions/6600507/c-try-except-statement) and [What is __in?](http://stackoverflow.com/questions/4973239/what-is-in-and-wsaapi) – Raymond Chen Sep 04 '13 at 03:55
  • 1
    Note: all symbols starting with double underbars are reserved for compiler usage, so if you see a symbol like __try, you know it has to be a compiler specific feature – Cort Ammon Sep 04 '13 at 05:52

0 Answers0