#Error: what(): stoi (Implementation of Stack)

4 messages · Page 1 of 1 (latest)

dire impBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

dire impBOT
#
Asking Your Question in the Right Channel

Welcome to Together C & C++. We have many channels on various topics, and encourage you to explore the channel list. Please ask your question in the appropriate channel:

Getting Programming Help
  • #1013107104678162544, #cpp-help-text for help with C++
  • #1013104018739974194, #c-help-text for help with C
  • #tooling if you can't get your code to run
  • the #360691955031867392 section for help with specific topics like algorithms
Showing off and Discussing Existing Code (any language)
  • #general-technical to discuss your projects
  • #c-cpp-discussion to discuss C and C++
  • #1078717238678409369 to get feedback
  • #1014328785685979136 to just show off
#
How to Ask a Programming Question

Anyone can ask a question in our programming channels. Following the guide Writing The Perfect Question is recommended.

What to Post

State your problem clearly and provide all necessary details:

  • the relevant portion of your code, or all of it
  • the expected output
  • the actual output (or the full error)
    :trophy: Gold Standard: Minimal Reproducible Example
Where to Post

Provide the relevant code in the message, and format it nicely with a code block*. If it's too much for one message, you can upload it:

  • Compiler Explorer for most C and C++ snippets
  • OnlineGDB for interaction, debugging
    :no_entry: Do not post screenshots, let alone photos of your screen!
#
Why Should I Format My Code, and How Do I Do It?

Well-formatted code is much easier to read, especially for people who haven't written it themselves. Poor formatting can even be misleading, especially indentation:

while (is_waiting);    // BAD! reader may think that
  std::cout << "hi\n"; // printing is in the loop

while (is_waiting) { } // good, empty statement
std::cout << "hi\n";   // is clearly visible
Rules for Code Formatting
  1. Stay consistent! (much easier when using auto-formatters)
  2. Don't use exotic styles that surprise readers.
  3. The rest is up to personal preference.
Auto-Formatting with clang-format

For C and C++, you can use clang-format to decide on a style, and apply it automatically to your files. You can use it in the terminal, or through an editor plugin.

Most IDEs will also let you configure a style in their settings, but clang-format is universal.

See Support/Plugins