Stuck on the First Step of Codecrafters C++ Guide

0
16
Asked By CuriousCat123 On

Hey everyone, I'm trying to work through the C++ guide on Codecrafters, and I've hit a wall right at the start. I downloaded Git and cloned the C++ repository, but when I try to run the command `git commit --allow-empty -m 'test'` followed by `git push origin master`, it executes without a problem. However, I'm facing an issue with the tests for Stage #OO8 (Print a prompt). The tester said it expected a prompt ("$ ") but got nothing, and the test failed. I'm supposed to uncomment some code in `src/main.cpp`, but I'm not exactly sure where that is or how to do it. I'm new to coding and learning on my own, using VSCode as my Git editor instead of Vim. Any help to get past this would be greatly appreciated!

2 Answers

Answered By HelpfulHacker99 On

It looks like the tester is pointing you to uncomment some lines in your `src/main.cpp` file. Try opening that file in VSCode and see if there's a line that starts with `//` - that means it's commented out. Removing the `//` before the code will activate it. You should also check for any hints in the tutorial that might tell you what to uncomment! Good luck!

CuriousCat123 -

Thanks for the tip! But I’m not really sure how to find `src/main.cpp`. When I run it, the screen just goes blank. How do I navigate to that file?

Answered By CodeNinja42 On

I remember going through the same thing! Make sure you open the entire project folder in VSCode. You should be able to see your `src` folder on the left sidebar. If you expand that, you should find `main.cpp` in there. Open it up and look for any commented lines that need unwinding. Let me know if you need more help!

CuriousCat123 -

That makes sense! I’ll check the sidebar for the folder and see if I can find it. Thanks for the help!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.