Software Developer (C++ Language) ChatGPT Cheat Sheet

Home

Code Review Assistance

ChatGPT can provide suggestions on coding best practices, potential optimizations, and help identify possible code smells.

Examples:

How can I optimize this piece of C++ code

{{code snippet}}

?
Can you find any potential issues or bad practices in the following C++ code?

{{code snippet}}

What's the most efficient way to write this C++ function?

{{function parameters and return type}}

Algorithm Explanation

ChatGPT can provide intuitive and understandable explanations of computer science algorithms.

Examples:

Explain the quicksort algorithm.
What is the best way to understand the Dijkstra's algorithm?
Can you explain Bellman Ford's algorithm in C++?

Coding Problem Solutions

ChatGPT can provide code snippets in response to a procedural problem.

Examples:

Write a C++ function to find the maximum element in an array.
How do I implement a binary search in C++?
Can you show me a code in C++ to connect to a MySql database?

Coding Interview Questions

ChatGPT can help prepare you for coding interview questions.

Examples:

What are some common C++ questions asked in interviews?
How to solve this coding interview question using C++?

{{coding question}}

Can you give some C++ coding problems for practicing algorithms?

Code Explanation

ChatGPT can provide plain English explanations of complex code snippets.

Examples:

Can you explain what this piece of C++ code does?

{{code snippet}}

What is the output of this C++ program?

{{complete program}}

What does this C++ function do?

{{function code}}

Debugging Help

ChatGPT can help you identify bugs or errors in your C++ code.

Examples:

I'm having trouble with my C++ code, here's the error message:

{{error message}}

. What could be going wrong?
My C++ program crashes with this error message

{{error message}}

. Can you help me understand why?
Why does my C++ function produce an incorrect output for these inputs?

{{function code, inputs and expected/actual output}}

© 2023 Calum | More Information | Feedback?