VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Memory - Intro to Computer Science - Harvard's CS50 (2018)

Memory - Intro to Computer Science - Harvard's CS50 (2018)

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Learn about computer memory and how it relates to programming. This course teaches the foundations of computer science. This video is lecture 3 of Harvard University's CS50 2018 course (part 4 since the lectures start at 0). Check out our full CS50 playlist: https://www.youtube.com/playlist?list=PLWKjhJtqVAbmGw5fN5BQlwuug-8bDmabi -CS50 IDE (must have free edX account): https://cs50.io/ -Notes: https://cs50.harvard.edu/x/2020/notes/3/ -Problem Set: https://cs50.harvard.edu/x/2020/psets/3/ -Source Code: https://cdn.cs50.net/2019/fall/lectures/3/src3.zip --Contents
Date: 2022-03-14

Comments and reviews: 10


That Compare2.c program did not work for me at all the way he did it.
I had to modify it slighly for some reason.
to this instead
#include -
#include -
#include -
bool compare_strings(string a, string b);-
int main(void)-
--
string s = get_string(-s: -);-
string t = get_string(-t: -);-
if (compare_strings(s,t))-
--
printf(-Same\n-);-
--
else -
--
printf(-Different\n-);-
--
--
bool compare_strings(string a, string b)-
--
if (strlen(a) != strlen(b))-
--
return false;-
--
int n = strlen(a);-
int i;-
for (i = 0; i < n; i++)-
--
if (a[i] != b[i])-
--
return false;-
--
--
return true;-
-

reply

I feel a bit mixed about this.
I am a software engineer. I have been for a time.
I have taken (and aced) countless CS courses while in school but I still have profound insight watching this supposed by number a 'half-assed CS' series...I get it, not advanced material but damn, it is so complete in layers for such a short class.
Did I spend a fortune for nothing??
I love the memory and data structures talks best:)

reply

The RETURN statement. He doesn't elaborate.
int main (void)-... means that the return value is an integer and there are no arguments. This works in all compilers. Some compilers have an implicit - - return 0; - at the end but it is best practice to include it.
void main(void) -... is allowed in some compilers but not all. This should be avoided for compatibility reasons.
zero = GOOD --- !zero = BAD

reply

at 1:23:35 the professor feels lucky, but is actually not. scanf with %s means -String of characters. This will read subsequent characters until a whitespace is found-. So even if you entered a lot of characters after -David -, because it's a whitespace after David, it prints ok. The segmentation fault example after that is due to the fact that are no spaces.
reply

At 45:00 a way better solution would be not to check strlength() first because it actually already has to scan the entire word until it finds a -\0-. Also, do not include a new for loop with strlenght in it. Simply create a While loop that checks the words char by char, until one (or both) end up being -\0-.
reply

Now I know why Bill Gates Left Harvard.
So as Mark Zuckerberg.
Segmentation Fault is an Error from Operating System.
Stack Overflow can be resolved by hard disks or external memories allocations.

reply

Okay, what's the difference between these two declaration of strings?
char -foo;
or
char foo[10];
This made me even more confused, when should I use the later, or the former?

reply

Thank you for explaining pointers in different way, I understand so much in this video. Had to watch it twice to memorize the concept, but the teacher is so good at explaining this.
reply

Nice, Can I get certification from this university (actually remotely even if paid) without wasting time from going from place to place............
reply

-freecodecamp, videos 5 and 6 in the CS50 playlist are not playable, as it says they are private videos and they can't be displayed.
reply
Add a review, comment






Other channel videos