Structs (Structures) in C - An Introductory Tutorial on typedefs, struct pointers, & arrow operator

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ • 47

  • @thisisreallyme3130
    @thisisreallyme3130 2 роки тому +17

    I'm confused why you do not have a lot more subscribers. :). I've watched a dozen other videos on introductory C, including the excellent CS50. You spending a full 30 minutes on this one topic is a perfect way to hammer the idea home. Thanks.

    • @KrisJordan
      @KrisJordan  2 роки тому +6

      I appreciate the feedback here and am glad to have helped!

    • @ridcully
      @ridcully 2 роки тому

      The UA-cam ‘algorithm’ is written in Perl

  • @grimvian
    @grimvian Рік тому

    At 17:09 I learned that, I have to use a struct name. I thought that the name was redundant, but it's absolutely not!
    Kris have an outstanding level of teaching, despite he's knowlegde of C properly feels like Kernigan!

  • @quangdungle9658
    @quangdungle9658 3 роки тому +2

    I was struggling in class and your video really helped me. Love the small exercise in the video and how you explain it.
    Thank you!

  • @shvideo1
    @shvideo1 3 роки тому +2

    Excellent and comprehensive introduction to structs. Thank you for this great tutorial that explains all the nuances and syntax so clearly. It is very useful.

    • @KrisJordan
      @KrisJordan  3 роки тому

      Thank you for the kind feedback!

  • @seek2imagine423
    @seek2imagine423 Рік тому

    I'm a full time fast paced web dev student currently in C programming. Thank you so much for this video! I'm struggling to learn C as I have to complete 3 sections a week. I'm not spending enough time before I have 3 more projects due. I generally love C but I won't lie and say it makes a lot of sense. It could be because I am about 8 weeks in. I'd love to watch every video on anything C. I looked through the videos and was really interested in Loops in C if anyone would like to respond with a link. I'd appreciate it!
    Thanks for the video, Mr. Jordan! This is really helping me compared to tons of different websites and youtube videos. My curriculum doesn't come with any books or much material so I am expected to do all my own research. I'm super looking forward to your pointer in C video.

  • @alfonsotoriz7563
    @alfonsotoriz7563 3 роки тому +2

    Thank you! I've been following Shaw's Learn C the Hard Way and thanks to your channel I've finally understood some key concepts :)

  • @angry_moose94
    @angry_moose94 2 роки тому

    A topic that seems so simple yet it is so fundamental. Enjoyed the way you explained the topic with thoughts about how the whole thing works under the hood. Will make sure to watch the rest of your videos!

  • @raphael.portela
    @raphael.portela Рік тому

    subscribed, you are one of the best in C progrraming, ive always struggled with pointers and structs, i got the idea on what the pointer represents and the usages , but when comes to struct I never fully understood

  • @not.harshit
    @not.harshit 3 роки тому +7

    You can also initialize your struct in this way.
    Point = {
    .x = 4.0,
    .y = 2.0
    };
    EDIT: This format also works when assigning values to structs.
    Point.x = 4.0;
    Point.y = 2.0;
    is equivalent to:
    Point = {
    .y = 4.0,
    .x = 2.0
    }
    (Notice that the elements of the struct can be listed in any order when assigning values)
    Currently only C(Clang) supports this style, C++ does not.

  • @FMisi
    @FMisi 3 роки тому +3

    14:50 iss the important part
    31:14 is important too

  • @bobsprite6711
    @bobsprite6711 9 місяців тому

    Excellent! Very clear and didactic!

  • @AlaskanInsights
    @AlaskanInsights 2 роки тому

    great refresher ...

  • @guilherme-gu7vv
    @guilherme-gu7vv 2 роки тому +1

    Thank you very much, you make such a great videos! 👍

  • @philfernandez835
    @philfernandez835 Рік тому +2

    Nice video! I learned allot. But, making points about pointers to variables of type Point did get a little confusing. Maybe could have named the struct type Coordinate or something? lol.

  • @adrianaerakovic9259
    @adrianaerakovic9259 3 роки тому

    Got yourself a new subscriber! well done!

  • @derkeiler2573
    @derkeiler2573 3 роки тому

    21:20 i m a little confused.. someone told me, that in *C* it is not possible to create a copy of a struct like shown in your example:
    point a = {0};
    point b = a;

  • @yonahcitron226
    @yonahcitron226 Рік тому

    Amazing stuff

  • @philipphortnagl2486
    @philipphortnagl2486 2 роки тому

    great content!

  • @redcrafterlppa303
    @redcrafterlppa303 2 роки тому

    23:25 I just explored java under the hood and discovered it's actually possible to get the equivalent of this code with some under the hood magic. Since every object except primitives are already pointers we can dereference them and write to the memory ignoring imaginary write protection (final, private...).

  • @iduran
    @iduran 2 роки тому

    Thanks a lot for your videos. I just found your channel as I want to learn to program in C. Probably you get this question a lot but didn't find the answer/comment in your other videos. What vim color scheme do you use here? Thanks in advance!

  • @Frisky0563
    @Frisky0563 2 роки тому

    I get the Point awesome explanation

  • @billc3114
    @billc3114 2 роки тому

    With the strict defined in stat.h, how could I view all members? I am thinking iteration. I can view st_ino. But I want to view all data with printf.

  • @MsMReff
    @MsMReff Рік тому

    About what book exactly you are talking about here?

  • @amirhossein5055
    @amirhossein5055 2 роки тому

    great

  • @azizaydi7400
    @azizaydi7400 3 роки тому

    thank you so much for this important course sir , pls what is the name of the book that u are using and thank you .

  • @jonsunderland7708
    @jonsunderland7708 2 роки тому

    Gruvbox?

  • @kcvinu
    @kcvinu Рік тому

    Hi, which is your font ?

  • @arnabmukherjee5840
    @arnabmukherjee5840 3 роки тому

    just awesome..

  • @issaabsi3804
    @issaabsi3804 2 роки тому

    thank you

  • @khomo12
    @khomo12 2 роки тому

    Nice!

  • @juliaperkins744
    @juliaperkins744 4 роки тому +5

    Can confirm OS students were confused by typedef & repetition of struct name (I was one)

    • @KrisJordan
      @KrisJordan  4 роки тому +2

      I'm optimistic the experience of OS will change dramatically once the pipeline of students who took 211 reaches the point of OS.

    • @juliaperkins744
      @juliaperkins744 4 роки тому +1

      @@KrisJordan confident it will, low key it’s helped already (@gdb)

  • @mesv2009
    @mesv2009 3 роки тому

    thank so much ! nice to follow u

  • @immyslave2952
    @immyslave2952 2 роки тому

    Thx bro

  • @Anythingforfreedom
    @Anythingforfreedom 2 роки тому

    You referenced a book and my eyes lit up. What book are you using?

    • @KrisJordan
      @KrisJordan  2 роки тому +3

      The C Programming Language by Kernighan and Ritchie

    • @Anythingforfreedom
      @Anythingforfreedom 2 роки тому +1

      @@KrisJordan Thanks again!

  • @0xMalWorld
    @0xMalWorld 2 роки тому

    thx

  • @AnimeMemesDaily
    @AnimeMemesDaily 4 роки тому

    interesting video

  • @johnnyappleprng614
    @johnnyappleprng614 3 роки тому

    LOL @ 15:35

  • @riverrunsthrough8268
    @riverrunsthrough8268 3 роки тому +2

    why would you call your struct point in a vid where you will be discussing pointers? to be cheeky or..? unneccesary distraction in my opinion. good content otherwise though, subbed

    • @KrisJordan
      @KrisJordan  2 роки тому +3

      In a redo I would go with Vector2. I do like the familiarity and simplicity of a simple point in the context of a cartesian coordinate system.