CS50 2018 - Lecture 2 - Arrays

Поделиться
HTML-код
  • Опубликовано: 29 янв 2025

Комментарии • 115

  • @joeyvico
    @joeyvico 6 лет назад +39

    Thank you a million times Mr. David Malan for your teachings. You made me love computer science even more if that was possible.

  • @borkers3788
    @borkers3788 5 лет назад +6

    Turn on subtitles at 46:08
    I appreciate the subtle humor of whoever wrote the subtitles, kudos to you.

  • @sanr6838
    @sanr6838 5 лет назад +7

    I have never really understood what are these algorithms.. Thank you very much Mr. Malan, all heroes don't wear capes!

  • @fylyp969
    @fylyp969 6 лет назад +8

    Very cinematic camera work on these videos. Love it.

  • @nemohoes9792
    @nemohoes9792 5 лет назад +6

    im thankful for this whole course being provided for free. thank you so much!

  • @gopalsaxena9615
    @gopalsaxena9615 5 лет назад +82

    thanku for providing the course for free

  • @JustINformU
    @JustINformU 6 лет назад +115

    He’s a really good instructor. Most cs constructors are very mundane and uninteresting

    • @charbelsarkis3567
      @charbelsarkis3567 6 лет назад

      He's enthusiastic and a little over the top.

    • @aldeen9190
      @aldeen9190 6 лет назад +12

      He is good cause he loves what he do

    • @legendary_chicken
      @legendary_chicken 6 лет назад

      Can vouch for that

    • @fritzhopper5145
      @fritzhopper5145 6 лет назад +15

      Guess what? He is the very person who made me fell in love with computer science.

    • @12B-m6l
      @12B-m6l 6 лет назад +1

      true. he does love what he do. (I've noticed I can still understand something if it's not grammatically correct. what does this portend about the future of languages?--)

  • @marlena14855
    @marlena14855 4 года назад +3

    Thanks a lot to Harvard University and David J. Malan for this courses . This teacher makes me love about computer science .

  • @panganibanjebwilfred
    @panganibanjebwilfred 5 лет назад

    I am able to learn deeper about computer science and not just half-ass learning. Thank you, Mr. David.

  • @braham.prakash
    @braham.prakash 5 лет назад +3

    Well i am a arts graduate and still watching this course!
    Yes i am able to understand it very easily

    • @davidjmalan
      @davidjmalan 5 лет назад +3

      So glad to hear! Welcome aboard!

  • @vibematters11
    @vibematters11 5 лет назад +10

    I love David J Malan😍

  • @degitalweb
    @degitalweb 5 лет назад

    David malan is awesome teacher i guess cs50 should teach in grade 10 for all the kids so they can chose a path to COMPUTER SCIENCE field. They way DAVID MALAN tought this class is superb n whole cs50 staff is very helpful love it. Thank you @Davidmallan

  • @wonpec
    @wonpec 5 лет назад

    1:00:37 A grammar question
    string s = get_string("Input: ");
    printf("Output:
    ");
    for (int i = 0, n = strlen(s); i < n; i++)
    {
    printf("%c
    ", s[i]);
    }
    in here s initialized as a string. how it can be used as string array -> s[i] without definition???

  • @peter_castle
    @peter_castle 5 лет назад

    David is an example and a inspiration!

  • @patriciawood6598
    @patriciawood6598 5 лет назад

    That sorting video was so satisfying.

  • @gavinwebster8737
    @gavinwebster8737 5 лет назад +2

    Sonification of the final algorithm comparisons, very cool.

    • @ahmadjamalmughal47
      @ahmadjamalmughal47 5 лет назад +1

      You think we can access that web page? It's simple yet very helpful.

  • @robinkohrs8097
    @robinkohrs8097 5 лет назад +1

    why does the c code not get compiled directly to binary? Why the intermediate assemly code?

  • @droptozro
    @droptozro 5 лет назад +4

    Really curious after the 1st week(lecture 2 technically), how many drop out after those Problem Sets of Mario and Cash/Credit? Those were good challenges. I'd been doing Python for a couple months and thought I could take C on the "more comfortable" level but I was wrong. I didn't even attempt Credit. I looked up someone else's solution online and realized I didn't have that capacity yet so I didn't submit one.

    • @yalongchu2474
      @yalongchu2474 5 лет назад +2

      yeah,it really need some experience even in pset1,so i amazed what harvod student hava done.if u are a newbie in programing and saved the pset1,i think u r really talent

    • @Michyme
      @Michyme 5 лет назад

      please i need help with mario

    • @droptozro
      @droptozro 5 лет назад

      @@Michyme Are you doing it on "less comfortable" in pieces as the website walks you through each example? If so, which part are you stuck on?

    • @Michyme
      @Michyme 5 лет назад

      Yes I’m doing the less comfortable. But it keeps producing the # in a straight line instead of a pyramid based a number that I input.

    • @droptozro
      @droptozro 5 лет назад

      @@Michyme I'm assuming you mean like this if you input 3?
      #
      #
      #
      I think you need another "for" loop if I remember right but its been a couple months since I've done it. I cant see my code right now since I'm at work.

  • @ishangoswami9462
    @ishangoswami9462 6 лет назад +5

    Just one word "AMAZING"

  • @MaiconMatos08
    @MaiconMatos08 5 лет назад

    This Guy Rocks!

  • @MultiSilverbolt
    @MultiSilverbolt 6 лет назад +6

    How did they crop David out without a blue/green screen?

    • @davidjmalan
      @davidjmalan 6 лет назад +23

      There's one off to the side!

  • @saiananth5857
    @saiananth5857 5 лет назад

    After including the header files like cs50.h,math.h is it necessary to mention them in clang while compiling

  • @burntt999
    @burntt999 5 лет назад

    Are you sure my outfit looks ok? 38:49
    Joking aside. This man is amazing. It looks like he burns more calories than someone in a spin class.

  • @unnitmetaliya8252
    @unnitmetaliya8252 6 лет назад +4

    This was just AMAZING! Wonderful class.

  • @tanieltari4539
    @tanieltari4539 5 лет назад +2

    Why couldnt i just define COUNT so it will not consume any memory and will be just evaluated in preprocessing state?

    • @dexter97_66
      @dexter97_66 5 лет назад

      i think its a bit early to talk about define at this stage of the course

  • @jackodum9643
    @jackodum9643 6 лет назад +1

    You are the best!

  • @shydragon5449
    @shydragon5449 6 лет назад +2

    Anyone know where can I get one of the stress ball?

    • @khanhchung4103
      @khanhchung4103 5 лет назад

      maybe you have to be a Harvard student and attend the class

  • @luqmanbuic6047
    @luqmanbuic6047 5 лет назад

    Hello sir give me idea about online classes with Harvard teachers

  • @finalsecretofchrono1339
    @finalsecretofchrono1339 5 лет назад +1

    The FAQ is down for CS50 EDX. Anyone know if we are allowed to resubmit problem sets?

    • @davidjmalan
      @davidjmalan 5 лет назад +1

      You may! We've fixed that link, cs50.readthedocs.io/faq/cs50x/.

  • @ubermensch5472
    @ubermensch5472 5 лет назад +1

    1:20:26 C99: Don't get too excited

  • @shaoxiongyuan2793
    @shaoxiongyuan2793 5 лет назад +1

    Great!

  • @mrfreeman901
    @mrfreeman901 6 лет назад +1

    Thank you very much really

  • @joohojeong597
    @joohojeong597 5 лет назад

    Quick Q though, how does string argv work? I mean I looked up and it is different than what c is usually

    • @evaporatedmist
      @evaporatedmist 5 лет назад

      Some arguments used here are based on CS50's customized library, namely cs50.h, and hence are different than standard C. Hope this helps!

    • @joohojeong597
      @joohojeong597 5 лет назад

      @@evaporatedmist Thanks, for the reply. But I think what I should say is how cs50.h takes string argv and turns into char * argv[] that compiler understands.

    • @evaporatedmist
      @evaporatedmist 5 лет назад

      @@joohojeong597 Ooh.. you can see the sc50.h file on CS50 IDE.. ide.cs50.io

  • @HomerkaBY
    @HomerkaBY 6 лет назад

    subtitles are delayed

  • @احمدسعيد-م2ل5ت
    @احمدسعيد-م2ل5ت 6 лет назад +11

    there is a delay in subtitle

    • @luiscortes4713
      @luiscortes4713 6 лет назад +6

      you have to choose the "English (automatically generated)"

  • @haitiancreolewithluciano
    @haitiancreolewithluciano 4 года назад

    Why doesn't Harvard have AC in that room? The teacher is sweating his soul out

  • @jordanalex8674
    @jordanalex8674 6 лет назад +2

    While I was building the scores 2 example on the sandbox, I kept getting an indexing error when outputting it. Turns out I was starting my "I" integer from 1 rather than 0. Changing it to 0 fixed it, however this is confusing to me. Do arrays always have to start at 0?

    • @sionpixley1303
      @sionpixley1303 6 лет назад +3

      Standard convention is to start at 0 when counting (like in for-loops) or for indexing an array
      If int array[3] = {5, 8, 1};
      Then array[0] is equal to 5. array[1] is equal to 8. array[2] is equal to 1. Be careful when trying to access array[3] as this is actually outside of the memory set aside for the array. This can be especially dangerous in C.
      Some languages allow for custom subscripts; meaning that instead of starting from 0, you could start from 1. However, this isn't the case for most languages. Many languages force you to start indexing from 0. Because of this, it is generally best to get into the practice of always starting from 0.

    • @jordanalex8674
      @jordanalex8674 6 лет назад

      Thanks so much for the explanation! Out of curiosity, what were to happen if you try to access something outside of the array? You said it is especially dangerous in C? Why so?

    • @sionpixley1303
      @sionpixley1303 6 лет назад +4

      Jordan Esquivel the reason that accessing an index outside of the array is dangerous (in C) is because it is undefined behavior. You might end up getting a segmentation fault. You might end up receiving some other memory location. It’s hard to predict what will happen, since it’s undefined.
      In most cases, it’s not really dangerous in the sense that you’d mess up your computer (since most operating systems prevent things like this). But it’s dangerous in the sense that the program might not flag an error. It might chug along like nothing is wrong, and you might believe that the code works like expected.
      Compare that with Java, for instance. If you try to access an index outside of the array’s memory, it will throw an exception letting you know “HEY YOU MESSED UP PLEASE FIX OR ELSE YOU CANT DO ANYTHING ELSE”. I’ll link an article that might help explain a bit more than I can in a RUclips comment.
      www.geeksforgeeks.org/accessing-array-bounds-ccpp/

    • @lizzienovigot
      @lizzienovigot 5 лет назад

      Yes. Yes they do. :))

  • @droptozro
    @droptozro 5 лет назад

    some of this explained help50 and style50 would have been great in the last lecture before the problem sets. I saw "help50" I remember, but had no clue what it did really. Guess that's my fault but I'm not sure it would have picked up any bugs in my code since that wasn't the fault. Style was bad in some spots though on my code and just now went back to the page to see the Style Guide link. Consider adding a short explanation of this stuff to the Lecture before this for the Problem Sets 1 rather than afterwards.

  • @davidallsopp4030
    @davidallsopp4030 4 года назад

    imagine if this guy ever took any stimulant..

  • @avp9225
    @avp9225 6 лет назад +1

    52:42

  • @gorgezhang3488
    @gorgezhang3488 6 лет назад +2

    I'm Chinese student.My English is poor.The subtitle is delay.Could you help me?

    • @gorgezhang3488
      @gorgezhang3488 6 лет назад

      Choosing automatically generated subtitles will be much better

    • @leandrog2785
      @leandrog2785 6 лет назад +3

      Automatically generated subtitles have became better than human generated ones, soon machines will take over the world!

    • @fritzhopper5145
      @fritzhopper5145 6 лет назад

      或者,你也可以观看bilibili上的转载版,会有中文字幕.NO DELAY

    • @gorgezhang3488
      @gorgezhang3488 6 лет назад

      @@fritzhopper5145 谢谢~

    • @fritzhopper5145
      @fritzhopper5145 6 лет назад

      @@gorgezhang3488 不客气

  • @nishantsingh653
    @nishantsingh653 6 лет назад

    First to comment"Loved it"

  • @illiadenysenko7776
    @illiadenysenko7776 5 лет назад +5

    I tried to find contact in my phone by break it to half as David did this with phonebook, but I failed((

    • @ali51717
      @ali51717 5 лет назад +1

      you probably missed ;

  • @osmanmohamed8638
    @osmanmohamed8638 5 лет назад

    Thank you Harvard university for courses

  • @azaky5385
    @azaky5385 5 лет назад

    I READ THIS CSGO

  • @awashmicrobe
    @awashmicrobe 6 лет назад +2

    great course and instructor but the Camera moves a lot makes it hard to follow

    • @sametcomert2972
      @sametcomert2972 6 лет назад +1

      no it makes the lecture interesting and you have to fully focus on the lecture

    • @saleheenyeead5969
      @saleheenyeead5969 6 лет назад

      @@sametcomert2972 you are right....it keeps my attention towards the subject

    • @mustafakarakas1116
      @mustafakarakas1116 5 лет назад +1

      @@sametcomert2972 Gozum yasli hemserisine rastlasan gurbetci gibiyim

    • @sametcomert2972
      @sametcomert2972 5 лет назад +1

      @@mustafakarakas1116 çok güzel bir kurs, böyle güzel kurslarda daha çok türk görmek dileğiyle :)

    • @mustafakarakas1116
      @mustafakarakas1116 5 лет назад +1

      Samet Cömert inşallah aslında 7. Lecture a kdr gelmiştim ama sonra kodların çok ağır geldiğini ve sadece izlediğimi farkettim şuan Python calisiyorum sentdexin oynatma listesindin hepimize başarılar :)

  • @dunkelap1065
    @dunkelap1065 6 лет назад +3

    what a god

  • @echoanatolia5721
    @echoanatolia5721 5 лет назад

    Just watch James while swapping

  • @zomakaja
    @zomakaja 6 лет назад

    Wow

  • @micaiasoliveira6337
    @micaiasoliveira6337 4 года назад +1

    oi

  • @islamelgendy5079
    @islamelgendy5079 5 лет назад

    is cs51 available for free ??

  • @shivamsingh-ds1lg
    @shivamsingh-ds1lg 6 лет назад

    Sir plz upload videos on pointer

  • @honeybee6978
    @honeybee6978 5 лет назад

    Who are the stupid people who disliked the video?

  • @atalay804
    @atalay804 Год назад

    52

  • @qazwsxqaz3163
    @qazwsxqaz3163 6 лет назад

    +++

  • @aldeen9190
    @aldeen9190 6 лет назад +1

    I cant c# cause I am programing in java

  • @taheralikhan7428
    @taheralikhan7428 6 лет назад

    awesome

  • @MasterSergius
    @MasterSergius 5 лет назад +3

    "html programmers" dislike this video

  • @holdover7415
    @holdover7415 5 лет назад

    I can teach better than him, much better.

  • @micaiasoliveira6337
    @micaiasoliveira6337 4 года назад +1

    oi