Great professor! A very good lecturer. I like how he pauses, waits for people to digest, asks if they understand, answers questions, then moves on. Also the way he explains things is superb. He uses clear and consise explanations yet they are not too jammed packed to make them hard to understand.
@alhaithamaljabri61266 жыл бұрын
Abdullah, Nice channel bruh!
@UberOcelot7 жыл бұрын
This guy is incredible, seriously maybe the best CS lecturer I've seen.
@frankie_goestohollywood4 жыл бұрын
Really!!! I could watch him for hours even if I don't understand everything he is saying :-) Fantastic Professor.
@paulchen3553 жыл бұрын
agreed !
@lucasroncatobatista99511 жыл бұрын
This professor is awesome! He explains how C manages memory in a very graphical and easy to understand way. He demystify pointer once forever...
@antonehmac11 жыл бұрын
Yeah, it seems to be a question that all teachers need to ask, and yet is difficult to frame well. You don't want to leave anyone behind but calling attention to something someone has missed is sensitive for both the student and the teacher, who may feel judged for remedial need or lack of clarity respectively. I think he handles it well, and the moment that became awkward appeared to be when he could tell a student wasn't following and he was urging that student to ask for the needed clarity.
@jaggis49143 жыл бұрын
I taught myself C. Thanks to Jerry!
@ehteramuddinmohammed39958 жыл бұрын
What a wonderful lecture!!! I like the way he teaches, the way he puts it down on board to make students visualise the happenings in the memory. Thank you for such a great explanation.
@timhawthorn79037 жыл бұрын
Thanks Jerry, this is exactly what I wanted to know. I feel like I'm finally understanding what goes on under the bonnet.
@PaulKruskamp10 жыл бұрын
It helps to be sitting next to a compiler while watching this.
@dimashur9 жыл бұрын
the last two lectures were so informative, i love this serious of lectures
@jtetrfs536711 жыл бұрын
The compiler won't do pointer arithmetic on void* pointers. So you want to trick the compiler into doing pointer arithmetic by casting to...something! So why char*? Because it is one byte in size. You could have also cast to int*, but then, since sizeof(int) = 4 * sizeof(char), you would need to do (i * elemSize) / 4. In other words, casting to char* gives you the simplest expression (and the most efficient, too).
@infinitesimotel12 жыл бұрын
really excellent lecturer and progression.
@AronNimzo15 жыл бұрын
I think it is better to call this swap function in follwing way: int main(void) { float x, y; swap(&x, &y, sizeof(x)); return 0; } As long as x and y have the same type it will work.
@AnkurSharma-je1ro4 жыл бұрын
We can check a pre condition in calling routine assert(sizeof(x) == sizeof(y))
@shanashinigami7 ай бұрын
Really great stuff, we're lucky to get access to such a stellar lecture
@maengu25 жыл бұрын
Thank you for the great and clear lecture!
@shobhitverma2478 Жыл бұрын
I'm going to share timestamps for whole video so that it'll be helpful for someone to save time. 23:37 - swapping two strings using generic swap function. 35:02 - writing generic linear search function.
@PixelPulse16811 жыл бұрын
Finally, I can understand the working principle of Pointer!!!!
@briane54679 жыл бұрын
#include double main (is that clear) {
@chelvan214 жыл бұрын
it should be for(int i = 0; i < n; i++) .. and n should be declare before.. by something
@Jurily14 жыл бұрын
@3dfabio "After a long and arduous process, the standard was completed in 1989 and ratified as ANSI X3.159-1989 "Programming Language C." This version of the language is often referred to as "ANSI C", or sometimes "C89" (to distinguish it from C99)."
@MarcusAseth7 жыл бұрын
I'll call my son People and send him to Stanford so that this great professor will make sure that this stuff make sense to him :D
@efeakn46724 жыл бұрын
ı tried that 30.00 Fred Wilma swap thing without the & it still made the swap :/
@alexpark-q8m7 жыл бұрын
great lecture ever
@loganrathbone385610 жыл бұрын
int main(void) { if ( !does_that_make_sense_to_people() ) professor_explodes(); return 0; }
@Moosorkh6 жыл бұрын
esle{ professor = gets-happy(); print(professor); }
@steffens.17345 жыл бұрын
@@franciscodeaguirre1754 C and Python, both have there advanteges and disadvanteges. With more progress in your learning you wouldn't repeat your comment.
@shadyganem54484 жыл бұрын
int main(void) { if ( !does_that_make_sense(&people) ) professor_explodes(); return 0; }
@ch3ragCS6 жыл бұрын
Still learning in 2017
@ValeriCFBG3 жыл бұрын
you could make generic swap to work for int and short by first casting the short to int
@anguruso12 жыл бұрын
These are really great examples. Except some of the naughty behaviour is being clamped down by my compiler. I'm using whatever C compiler comes with VS2010
@jeyosman18 ай бұрын
which book do recommand me to read about memory like this class now
@thedylan12345678912 жыл бұрын
try using MinW32 and GCC or cygwin and GCC
@matthewsmeets5 жыл бұрын
It's a good idea that these lectures were recorded, even from home at 75% speed I cannot keep up with making notes.
@Martin145621513 жыл бұрын
At 43:30 he is using a "hack". He casts base to char* and he mentions that it is also possible to use an unsigned long* instead of char*. Why is it possible to use unsigned long*? Unsigned long is a 4 byte datatype, char 1 byte.
@platcrab48907 жыл бұрын
Martin Ennemoser char is also 4
@dragosborosgpt15 жыл бұрын
quite clear, thanks
@firefokos16 жыл бұрын
This is great thank you
@lekimsey14 жыл бұрын
good teaching.
@alibabascience94063 жыл бұрын
how a void *lsearch return elemAddr ? Professor, thank you is verry hard explication
@jamesedmonds681411 жыл бұрын
most people have either 32 bit or 64 bit systems, if you watched his first video he says to assume a int is 4 bytes and a long is 8 while a char is 2. He did say it was system specific. Your like jumping into a middle of a conversation spouting out stuff trying to sound smart. Listen from the start then you should feel stupid.
@platcrab48907 жыл бұрын
James Edmonds I'm pretty sure a char is 4 bytes
@oneplusonetwo7 жыл бұрын
43:00 i dont understand why pointer type has anything to do with pointer arithmetic, the compiler should always know the what hardware it is running on, so it should always know the size of mem address, like 32bit or 64bit. so for example, compiler running on 32 bit system, then "base" should contain a 32bits long data(address of void *base), and "i" and "elemSize" are both int(also 32 bits long), so why compiler don't know how to interpret? or why compiler don't do void * pointer arithmetic?
@yoyuepz13 жыл бұрын
@dimipeli yea i think this as well.. and being from stanford they wouldnt make as many mistakes as other "normal" univerisites? Maybe i am wrong? But i do like this teacher! :)
@irock911412 жыл бұрын
can somebody explain what he did with that char* hack (at 43:30)? :S tried that piece of code on searching a 10 element integer array.. it worked fine with (char*) and (short*) casts. but the program crashed when i used (int*) and (unsigned long*).
@Arunsharma-tf5xp5 жыл бұрын
Why he hadn't use "*" inside that void swap function in as memcopy(*vp1, *vp1, size) because writing just vp1 return it's address not it's value that it is actually pointing 🙄
@aayushchhabra74655 жыл бұрын
That is due to the specification of memcpy function. memcpy explicitly expects you to pass the locations of destination and source without dereferencing it.
@bobesfanchi4 жыл бұрын
You can't derefrence a void pointer. C++ needs to know the size of the pointer to be able to deref it.
@DeBaimbo12 жыл бұрын
Is there a book that treats exactly these subjects? I like listening to this professor, but I feel more comfortable studying on a book.
@AnkurSharma-je1ro4 жыл бұрын
Computer science: A Programmer's perspective
@DeBaimbo4 жыл бұрын
@@AnkurSharma-je1ro Thanks!
@linosnoto12 жыл бұрын
where can i find the assignments
@danielgray80532 жыл бұрын
did you find them?
@ncmathsadist8 жыл бұрын
the bad swap near 51:00 gave me a "bus error 10."
@666friends14 жыл бұрын
@NameNotaNumber A good programmer knows at least one language from the different programming types.
@Kikeron12 жыл бұрын
He says afterwards "It’s incidentally normal math with char *s because characters are 1-byte wide, so the scaling factor is just 1, okay?"
@bishalthapa46397 жыл бұрын
That's heavy :)
@SuperGanga201013 жыл бұрын
@dimipeli Yeah, he does. But sometimes students' questions aren't well-formed and understandable, so as soon as the lecture is being filmed, he has no time for such things. Would you like to see how he tries to understand students' questions for 1 minute or so instead of telling new information? I wouldn't.
@jakefund672810 жыл бұрын
Trying to run project 2 - Segmentation fault =(
@ductran591310 жыл бұрын
I got seg fault 11 when run imdb-test. Any one help please :)
@flyaloy18 жыл бұрын
this happens when you try to access to a memory reference that doesn't belong to your program, maybe your pointer is out of range of something like that.
@matthewsmeets5 жыл бұрын
@@flyaloy1 Correct, try allocating some random local variables around your code so you have a bigger heap to work with.
@jamesedmonds681411 жыл бұрын
he says it in the video more than once.
@YoungYSL11 жыл бұрын
Well I can't understand why audience is so dissatisfied. I don't know wether it is normal in USA, maybe cause I am from Ukraine. Here we have absolutely different type of interaction between class and lecturer. P.S. Lecturer does his work in a great way, really miss such lecturers in UA
@aajr9511 жыл бұрын
thats because its over all of their heads
@invalidacess16 жыл бұрын
lol so true lol... i notice that the views keep getting smaller and smaller as u go from lecture 1 - 4 lol wonder y?
@AnkurSharma-je1ro4 жыл бұрын
Thats is surfing vs following
@Grundalizer14 жыл бұрын
I do not get programming at all.
@rhshriva15 жыл бұрын
bible of C
@dimipeli14 жыл бұрын
He makes some mistakes here and there, and misinterprets some of the students' questions, but he is still a good lecturer.
@rrook886 жыл бұрын
look like beggining of mem fragmentation.. solution. buy defrag software
@acho8387 Жыл бұрын
Am I the only one getting super distracted by this "does that make sense" every other sentence? It really breaks my focus..