Open iankode opened 6 months ago
Hello,
As I mentioned recently, the publisher modified the files I sent to them and uploaded the wrong version to the repository. Immediately after receiving the information from you, I contacted the publisher regarding this problem. It seems that the appropriate version of the files is currently already in the repository and there should be no problems with building the solution. I would be very grateful if you could check if everything is working fine and thanks again for reporting the problem!
If you have any questions or problems, I will be happy to help. The easiest way to contact me directly is via the contact details on my website, i.e. https://marcin.com :-)
Have a nice day! Marcin
After downloading the companion code from Pack for the "C# Data Structures and Algorithms - Second Edition" [ISBN 9781803248271] https://www.packtpub.com/product/c-data-structures-and-algorithms-second-edition/9781803248271 Download code from GitHub that redirects to the common repository https://github.com/PacktPublishing/C-Sharp-Data-Structures-and-Algorithms---Second-Edition/tree/main
but unfortunately not all the code samples actually compile! This Issue reports failures within Chapter03\SortingAlgorithms project
In SelectionSort.cs just prior to class definition has a spurious definition of AbstractSort this conflicts with the correct definition in AbstractSort.cs
Likewise the SelectionSort.cs also contains a spurious Program class (and static void Main entry point) that VS sensibly ignores with CS7022 warning, and the CSC implies the SVM for the actual top-level Program.cs
Because the class definition lacks the public assessor
class SelectionSort : AbstractSort
the Program tries to bind to the namespace instead and raises CS0260 errorEasy to make public
public class SelectionSort : AbstractSort
but [to be equivalent to other *.cs files] also better to suppress the local block namespace as already defaulted in .csproj by<RootNamespace>_03_SortingAlgorithms</RootNamespace>
I will now raise a PR hoping that Packt and author Dr Marcin Jamro will agree [to the benefit of subsequent subscribers] (I'm also hoping that each of these PRs will merit Packt awarding me an extra Credit to offset my time & effort!)
BTW this PR builds on my earlier PR #2 (Issue #1) so I hope that Packt & Marcin have already accepted that.