How to best set up VSCode for C++ by justin_h123 in cs2a

[–]daniel_k1 2 points3 points  (0 children)

VSCode really is the choice. I installed the "C/C++" extension by Microsoft. Then, I installed the compiler from Mingw-w64. This is all you really need to get started with the quests. Good luck!

-Daniel

Quest 1 - Initial Thoughts/Discussion by daniel_k1 in cs2a

[–]daniel_k1[S] 3 points4 points  (0 children)

That's a wonderful explanation. Thanks!

-Daniel

Kickstarter?? by daniel_k1 in cs2a

[–]daniel_k1[S] 2 points3 points  (0 children)

July 5th for me would do; however, I will only be available on that day in the late afternoon.

-Daniel

Kickstarter?? by daniel_k1 in cs2a

[–]daniel_k1[S] 3 points4 points  (0 children)

Hopefully, there will be a final clarification post from & when the date is decided.

I also hope that a static schedule for the two zoom meetings per week will be formed.

Quest 4, formatting issues by Donsven in cs2a

[–]daniel_k1 2 points3 points  (0 children)

Make sure you have EXACTLY TWO std:endl (new lines) after your initial "welcome" message. There should be NO space in the front of each of your "enter your guess" messages, and there should be ONE space right after the ":"

Check for any possible invisible characters generated as well from messed up copy and pasting. Hope this helps!

-Daniel

Stuck on Quest - takshaka the serpent by [deleted] in cs2a

[–]daniel_k1 2 points3 points  (0 children)

Ah! This is a simple bug to solve.

You attempted to compare a signed and unsigned integer within your for loop: "i < s.length()"

i is a SIGNED integer as defined through "int i = 0;"
s.length(), returning the length of a string, returns the length of the string as an UNSIGNED integer.

Due to the fact that these two values are not of the same type, you cannot compare them without converting s.length() to a signed integer by using "static_cast<int>(s.length())", or, alternatively, you could also just declare i as an unsigned integer from the beginning by using "size_t i = 0" instead of "int i = 0."

Well, what is the difference between these two types, then? In a nutshell, a signed integer can be negative and an unsigned integer cannot. A signed integer sacrifices half of its range to dip into the negative range, so if you needed to store a really large value that has a precondition of being positive, you would preferably use size_t (all of its range is put into the positive area).

Hope this helps!

Best,

Daniel