Resources for C++
- Installing CLion (exercise 1, linked here for
future reference)
- Part of this is disabling Clang-Tidy and
Clazy: Settings..., Editor, Inspections, C/C++,
and then clear the checkmark for Static Analysis Tools.
- An Overview of the
C++ Programming Language by Bjarne Stroustrup, the creator of
C++.
- Replit C++
Environment: a simple way to run short C++ programs, especially
if you are having problems on your computer.
- cplusplus.com: a great
reference for C++. If you don't understand what this site is saying,
review the relevant terms in the textbook; this site assumes readers
generally understand C++.
- Caution! Stack Overflow (SO) is a dangerous resource for this
course: many suggestions there do not apply to the type of C++ code you
should be writing for CSC 2210. On the other hand, SO at least generally
contains factual information; there are high-profile sites that provide
no additional information beyond what you can find explained more clearly
in your textbook.
Fixing C++ Problems
- C++ Compiler errors and fixes
- Debugging 201: Debugging memory
faults in C++ such as random runtime errors, segmentation faults,
and even infinite loops.
- My program runs on my machine but not esubmit: This means you
have a memory fault; see the previous bullet.
- How do I submit input to a running program on my machine? You
can simply enter the input into the CLion console, but if the program reads
input until reaching end-of-file, then the most robust solution is to
configure it to read input from a file. With your project open in CLion,
click on the three vertical dots next to the debug symbol,
select Edit... (for the run configuration), select the Redirect
input from box, and browse to a file
like
my_input.in
. Then you can run and debug your code as
usual with the input coming from this file instead of the console (that is,
instead of the keyboard). An alternative method which may work is
to change options to allow Control-D to mark the end of input:
Help | Find action | Registry | disable run.processes.with.pty. However, it
is not clear if this would have other impacts on running programs.
Other Useful Resources
Practice
This is a partial list of sites you can use to get more practice with C++
and C. I have not tried all of these, and there are many
alternatives. Message me with your favorite!