Skip to content

Overview

As you have seen, the syntax for the statements within your code are almost exactly the same in C/C++ as they were in C#. Have a bit of a practice with this by reimplementing some of your earlier C# programs.

This process can be fairly mechanical:

  • Copy your code over.
  • Wrap the logic within int main() {...}.
  • Adjust the includes at the start.
  • Adjust identifiers from PascalCase to snake_case.
  • Change conversion methods to their C/C++ equivalents.

For both of these examples it would be great to do the conversion yourself. This will really help you see how similar the code is. The main thing is to follow the logic — the way you think about this in C# is exactly the same as the way you think about this in C/C++.

Make sure that you have things working before you move on to the next chapter. You should feel confident that your understanding of sequence, data, and control flow applies equally to C/C++ as it did in C#.