Post-increment vs pre-increment in C (a++ vs ++a)

Поделиться
HTML-код
  • Опубликовано: 20 янв 2022
  • Source code can be found here:
    code-vault.net/lesson/
    ===== Support us through our store =====
    code-vault.net/shop
    ===== Check out our website =====
    code-vault.net
    ===== Check out our Discord server =====
    discord.code-vault.net

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

  • @alexandrealexandre6006
    @alexandrealexandre6006 2 года назад +7

    Greetings from Brazil!
    Your videos are helping many software engineering students from my school.
    Thanks for the content and great explanations! :D

  • @ronshabi6210
    @ronshabi6210 2 года назад

    You're back!!
    Thank you as always!

  • @danielkusmaul3945
    @danielkusmaul3945 Год назад +1

    Saw that you've been inactive, but happy to see your still actively answering questions in the comments. Hope your doing well!

    • @CodeVault
      @CodeVault  Год назад +1

      I'm doing alright. I'm planning on uploading new content soon

  • @alexandrupaulescu
    @alexandrupaulescu 2 года назад

    M-ai ajutat mult pentru Politehnica la lectiile de fisiere si serializare in struct. Multumesc mult si spor pe viitor!

  • @CediCore
    @CediCore Год назад +1

    I am so happy that I found You. You are the prototype perfect teacher in my world

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

    Thank you so much for these fantastic explanations! You are a Code Saint! 👼

  • @mohamedilyes375
    @mohamedilyes375 2 года назад +1

    you always have excellent videos
    thanks I learned a lot from you
    Greetings from Algeria

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

    Thanks for this nice tutorial!

  • @20sbillionaires
    @20sbillionaires 9 месяцев назад

    thank you:)

  • @ShermukhammadKarimov
    @ShermukhammadKarimov 4 месяца назад

    Thank you so much

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

    amazing explanation!

  • @eva.s
    @eva.s 2 года назад

    You're the best!

  • @OnlyfansCustomerSupport
    @OnlyfansCustomerSupport 2 года назад

    this helped me alot fix some logics behind recursive exam quests :D in all but one of them the print of the recursive function did just "print" the finished value that was called in printf %d , function ... but this one bugger returned a number-- and i didnt get it that the system returns 2 values the untouched value and the decremented one.. and it shows the untouched one return to the print .. waited for the "for" loop to end and then before it opened the next recursion it then accepted its decremented faith xD .... the hardest part to C is just that these small littl logics that our professor understands at 3am drunk.... isnt integrated in all fine details in us when he explains the core function of the project he uses :D

  • @anstbt
    @anstbt 2 года назад +1

    hello sir , could you make a video about the Dining Philosophers problem using mutexes in c. (threads)

  • @pseudounknow5559
    @pseudounknow5559 2 года назад

    Excellent

  • @kapellimestari0078
    @kapellimestari0078 2 года назад +2

    It would be very nice, if you make a video or a series of videos explaining everything about git, and github and so on, please

    • @CodeVault
      @CodeVault  2 года назад

      It's definitely on my todo list! Thanks for the recommendation

  • @titouanck
    @titouanck 2 года назад

    Thanks

  • @kevinbravo7694
    @kevinbravo7694 2 года назад +1

    hello can you explain / implement the heap in c? I found your stack video very helpful in understanding the concept and would like to view the heap in depth as well

    • @CodeVault
      @CodeVault  2 года назад +3

      I will look into it

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

    Expecting Socket programming playlist in C.

  • @funelwar6734
    @funelwar6734 Год назад +1

    Hello Sir You are very helpful To me may i know sir where are you now ? Please Start regular lecture I love and Studied from your video hope we can see you again
    And All the best to you whatever you doing you will got sucess God Bless!!

    • @CodeVault
      @CodeVault  Год назад +2

      Will do. Thanks for the support

  • @vigneshnayak2012
    @vigneshnayak2012 2 года назад +1

    Can you please do a video on va_list, va_start and about variadic functions

    • @CodeVault
      @CodeVault  2 года назад +1

      Yes, I'll look into it. Thanks for the recommendation!

  • @kapellimestari0078
    @kapellimestari0078 2 года назад

    very good

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

    This channel made me realize I know nothing of C lol

  • @max.hastings
    @max.hastings 2 года назад

    what keyboard do you use? I love the noise lol

    • @CodeVault
      @CodeVault  2 года назад

      DasKeyboard model S (brown switches). The keyboard has been with me for the last 9 years

  • @robertosanz9501
    @robertosanz9501 2 года назад +1

    Hi there, can you do some videos about shared memory in linux? Thanks for your videos you are helping me so much with the OS course

    • @CodeVault
      @CodeVault  2 года назад +2

      Yes, I will look into it

  • @nachochilli7683
    @nachochilli7683 Год назад +1

    Hello your C videos are amazing ✨✨💖thank you! Can you make tutorials on app development for beginners?

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

      iOS and Android? Probably I will start with some web development as that's widely used in app development these days. And go from there

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

      @@CodeVault Android please

  • @donttrackme8590
    @donttrackme8590 2 года назад

    What happen when we compare two variable from different types in C (in x86 arch) ?

    • @CodeVault
      @CodeVault  2 года назад

      You usually just get a compilation error

  • @riccardosebastiani4571
    @riccardosebastiani4571 2 года назад +1

    Good morning Sir, could you do a video about pointers of array of struct?
    Like this:
    Struct struct_1 *p[ ] ;
    I mean, how can I use them in other functions (Not in Main)?

    • @riccardosebastiani4571
      @riccardosebastiani4571 2 года назад

      My program is working now!
      If you guy need help, use malloc for each index of the array and use *p[ ] in the prototype.
      Use the arrow operator ( p[i]->something )
      REMEMBER to free each index

    • @riccardosebastiani4571
      @riccardosebastiani4571 2 года назад

      Anyway, I think is good idea doing a video about array of pointers.
      This can help everyone

    • @CodeVault
      @CodeVault  2 года назад

      There is this video: code-vault.net/course/ar67avx6hk:1610029043923/lesson/he9jn5x8b1:1603733522083
      But I will also keep in mind and make a video specific to your problem

    • @riccardosebastiani4571
      @riccardosebastiani4571 2 года назад +1

      @@CodeVault thank you!
      I will see it, have a nice day

  • @zainebgabsi5500
    @zainebgabsi5500 Год назад +1

    can u help me with a shcool project urgently , i need to make a shell that executes 2 commands with && , between them . please help

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

      You can ask on discord about this: discord.code-vault.net

  • @bartlomiejodachowski
    @bartlomiejodachowski 2 года назад

    Hi, is there video of yours where you mention about arrays size of 0 ???

    • @CodeVault
      @CodeVault  2 года назад

      Arrays that have size = 0 you mean?

    • @bartlomiejodachowski
      @bartlomiejodachowski 2 года назад

      @@CodeVault yes. for example thre is a trick like this:
      typedef struct Message
      {
      unsigned id;
      char text[0];
      }M;
      M* m1 = malloc
      *(sizeof(M) + sizeof(char)*n)* ; _//now m1->text has size n instead of 0_
      works only when empty array is last member of a struct, but what is this empty array?

    • @CodeVault
      @CodeVault  2 года назад +1

      Apparently it's called "flexible array member". Here's more details: stackoverflow.com/questions/36577094/array-of-size-0-at-the-end-of-struct
      I might make a video on this as I never used such a feature

    • @bartlomiejodachowski
      @bartlomiejodachowski 2 года назад

      @@CodeVault thanks :D
      I'm looking forward it

  • @jr_jeet
    @jr_jeet 8 месяцев назад

    nicenecineceeeee

  • @suncrafterspielt9479
    @suncrafterspielt9479 Год назад +2

    Hey, I hope you are ok. Have not heard from you in a while

    • @CodeVault
      @CodeVault  Год назад +4

      I'm alright, just busy overall. Thanks for your concern

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

    Hi could you pls do videos on asynchronous io like epoll pls

  • @ForeverNils
    @ForeverNils 2 года назад

    Can you please explain why do you use GCC why not CLANG?

    • @CodeVault
      @CodeVault  Год назад +1

      You can use whichever compiler you want. The only reason I use GCC is because I was familiar with it on Linux, that's about it

  • @tigranav.3960
    @tigranav.3960 2 года назад

    is ++a actually faster than a++ for base types (not for iterators)?

    • @kingneo4913
      @kingneo4913 2 года назад

      Yes! Not much, but yes

    • @CodeVault
      @CodeVault  2 года назад +1

      That's an interesting question. From what I read ++a and a++ in C, for integers, without using their values are exactly the same (the compiler does some optimizations). If using the value, you should expect that ++a is better since a++ has to store a temporary value and then increment a. Here are some links:
      stackoverflow.com/questions/24901/is-there-a-performance-difference-between-i-and-i-in-c
      stackoverflow.com/questions/24886/is-there-a-performance-difference-between-i-and-i-in-c/24887#24887
      Now, I haven't fully researched this and certainly not on multiple architecture and compilers. If anyone else knows a better answer please feel free to post it here and I'll pin it!

    • @tigranav.3960
      @tigranav.3960 2 года назад

      @@CodeVault thanks a lot

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

    hello can you help find the bug in my program if i send it to you? I have been really stressed and I don't know what is wrong

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

      Sure, I can help

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

      I figured it out! Now I’m on a new assignment for djiskters algorithm

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

      @@CodeVault I wonder how I could acquire such help from you if I ever actually needed it for something

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

      @@DataStructures Fastest way is to just use the comments. I try to read and/or reply to every single comment. You could also direct message me on discord: discord.code-vault.net

  • @ramakrishna4092
    @ramakrishna4092 2 года назад

    Hi can you explain floating point representation in IEEE 754 FORMAT IN C LANGUAGE I am waiting for more videos like I have also registered in your site

    • @CodeVault
      @CodeVault  2 года назад

      Yes! It's an interesting topic and I have it on my todo list for a while. I'll see what I can do.

  • @ryanalnaser914
    @ryanalnaser914 2 года назад

    whatever anything I do or did