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.
58 messages ยท Page 1 of 1 (latest)
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.
so a few things
using namespace std will import all the symbols from std into the enclosing namespace. This can easily lead to name collisions, as the standard library is filled with common names: get, count, map, array, etc.
A key concern with using namespace std; is not what is imported now but rather what may suddenly be imported in the future.
While using namespace std; is alright for tiny projects, it is important to move away from it as soon as possible. Consider less intrusive alternatives:
// OK: *only* import std::vector
using std::vector;
// OK: namespace alias
namespace chr = std::chrono;
chr::duration x;
oh yes, i have to lol
i know its bad practice, and my prof even said it is, but we have to use namespace std
alright
do you get errors, or do you get an unexpected/incorrect output or behavior
unexpected/incorrect output
did you try to use a debugger?
i have to run it through this autograder which checks it through files and thats the picture where i showed the hints
no how do i do that ๐
what are u using to run ur code?
only the autograder?
( a debugger allows you to run your code line by line
no i use the text files my prof provided and run it myself, we use code blocks, and then ill check it with the autograder as that checks more like the requirements given
okay
so you have a debugger iirc
you can add breakpoints in your code by clicking next to the line numbers for sure
and then a red play button starts the debugger
but i didnt use C::B for like 4 years so i dont really remember
but I'd highly suggest switching to Visual Studio (not Visual Studio Code)
do i have to pay for it
ill do it, i just get taught on c::b so its like just convenient
no
Visual Studo Community is free
but if you have a university microsoft login u might get a free Enterprise version with that
oki, is this to help me debug it?
its much easier to help with Visual Studio as it's used more than CB
yes
which one should i download like the workload
i just see 3 with c++
im assuming universal development but ima download all 3
all
this is on university wifi im sorry its taking forever LOL
oki doki i got it all downloaded
which one should i use
oh i got it
ok ima past my code now
okay so im getting different errors with this code
It's saying miscelainious files, which IIRC happens when you dont create a new application. To use it you have to create a new console application.
Also, since it's a pretty small application with only 3 files that I can see, you can also try copy pasting to OnlineGDB (max: 3 files): https://onlinegdb.com/qBfWYO5TO
VS is a lot better than onlinegdb, but the latter is easier to share a pre-made setup
okay so i think im just confused, is my code failing because of my code, or where im putting it? my original code is on c::b and thats where im supposed to do it, but im using VS to get more assistance (but now i think im confusing myself even more)
VS is designed around projects, so you need to create a new project.
Basically it's failing because of where the files are
oooooh oki doki
I want to learn c
From where should I learn?
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity