Which one to use? - Command Line Arguments in Windows (with & without C Runtime)

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

ความคิดเห็น • 11

  • @StefanWelke
    @StefanWelke 11 หลายเดือนก่อน +1

    I like the variety in your approaches as well as the way and rate at which you are speaking

  • @bbcchi77
    @bbcchi77 11 หลายเดือนก่อน

    Great video! Can't wait to see what else you have in store...

  • @krecix
    @krecix 11 หลายเดือนก่อน +1

    Man, you posted this video at the right moment, i started coding a framework for a set of command line utilities i want to make using windows API. Shortly after i encountered the specific problem, i opened youtube and god bless your video popped. Looking forward to see more of this series!

    • @DaniCrunch
      @DaniCrunch  11 หลายเดือนก่อน

      Glad you found it helpful

  • @henrik7111
    @henrik7111 11 หลายเดือนก่อน

    excellent video!! while you were showing your version of the crt style parsing I was thinking "why re-implement weird legacy behavior?"
    and when you showed your personal approach I was relieved 😅 I really liked your approach, such an elegant way of handling it!
    I personally avoid c style strings in my own code so I would make something really similar but use a length instead of modifying the string.
    I am a really loving all these "non c runtime" videos and really like this longer format, love the pacing and the soft background music!

    • @DaniCrunch
      @DaniCrunch  11 หลายเดือนก่อน +1

      Thank you. I am also not a fan of null terminated C style strings, but there is some windows APIs that still only accept C style strings. But for everything that doesn’t need to be passed to those I usually don’t bother with it either.

  • @rayleighslivers2187
    @rayleighslivers2187 11 หลายเดือนก่อน +1

    I thought that "\\" means that you are escaping the back slash so it would be parsed as just "\". I thought thats why you put "\\" instead of "\" for windows path

    • @DaniCrunch
      @DaniCrunch  11 หลายเดือนก่อน +2

      For paths that is the case. But when you pass a path as a command line argument it will just leave the backslash pair as-is unless they are followed by a quotation mark. When you then pass that path to a windows function that takes a path it presumably treats the double backslash as an escaped character.
      If you check the links in the description you can read the rules specified by Microsoft. It is a bit odd in my opinion but probably has some historical reason why it works the way it does.

  • @DOS_Hoss
    @DOS_Hoss 11 หลายเดือนก่อน

    Yeah I like this style but as you say is a lot of work but maybe every now and then?

    • @DaniCrunch
      @DaniCrunch  11 หลายเดือนก่อน +1

      I think that would be doable haha

  • @Alibaba-id4dw
    @Alibaba-id4dw 11 หลายเดือนก่อน

    On windows you should use windows, command line is an artifact of the past. Python libraries are preferable to command line programs.
    Command line still have its uses, but that's something I'd prefer to keep you average user away from.