C++: Difference between revisions

464 bytes added ,  29 October 2019
Line 14: Line 14:


===Syntax===
===Syntax===
====Main====
All C++ programs launch in a <code>main</code> function.
Similar to [[C]], the arguments are <code>int argc</code> and <code>char *argv[]</code>.
These can be easily converted to a <code>std::vector<std::string></code> for convenience.
<syntaxhighlight lang="cpp">
#include <string>
#include <vector>
int main(int argc, char *argv[]) {
  std::vector<std::string> args(argv, argv + argc);
  // Your code here
  return EXIT_SUCCESS;
}
</syntaxhighlight>
====Lambda Expressions====
====Lambda Expressions====
[https://en.cppreference.com/w/cpp/language/lambda Reference]
[https://en.cppreference.com/w/cpp/language/lambda Reference]


====Casting====
====Casting====