Harvard - CS50 Week3 Review

Why struct is important? The struct data type offers a way to represent the concept of abstraction, helping us create software that is both understandable and less prone to errors. For example, we can use two arrays to represent people’s name and phone number. func main() { people := [3]string{"Andy", "Ben", "Cindy"} phoneNumber := [3]string{"0911-111-111", "0922-222-222", "0933-333-333"} fmt.Printf("%s's number is %s\n", people[0], phoneNumber[0]) } This code is highly prone to errors, such as the possibility of a typo mistake leading to an incorrect assignment of phone numbers....

June 27, 2023 · 5 min · Lester

Harvard - CS50 Week2 Review

What is the difference between make and clang? Clang $ clang -o hello hello.c Clang is a compiler tool that facilitates the compilation of source code into an executable binary file. Make $ make hello make is a build automation tool that helps in compiling and building software projects by automating the process of building executable programs and libraries from your source code.  Both Clang and Make are equipped with the ability to compile source code into an executable binary file....

April 18, 2023 · 3 min · Lester

Harvard - CS50 Week1 Review

Something new for me How to say int i = 0 ? We will say i get zero. Any zero in computer is false and any non-zero value is true. What is compiler? A compiler is an application that can transform source code into machine code. How computer to represent negative numbers? There are have three ways to represent negative numbers in binary....

April 11, 2023 · 2 min · Lester

Harvard - CS50 Week0 Review

What ultimately matters in this course is not so much where you end up relative to your classmates but where you end up relative to yourself when you began When you’re learning something new, don’t compare yourself to others. Instead, focus on what you’ve learned through the learning process. What does computer science actually do? Computer science is the study of information....

February 28, 2023 · 3 min · Lester