ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

What is the ternary operator ❓

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 เม.ย. 2022
  • #C++ #ternary #operator
    C++ ternary operator tutorial example explained
    condition ? expression1 : expression2

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

  • @BroCodez
    @BroCodez  2 ปีที่แล้ว +10

    #include
    int main()
    {
    // ternary operator ?: = replacement to an if/else statement
    // condition ? expression1 : expression2;
    //int grade = 50;
    //grade >= 60 ? std::cout

  • @khoicoi7338
    @khoicoi7338 2 ปีที่แล้ว +10

    I'm so lucky to have found your channel

  • @Angelics
    @Angelics 2 ปีที่แล้ว +7

    hello bro code, your videos teached me js. you really inspired me!

  • @flamev2981
    @flamev2981 2 ปีที่แล้ว +8

    Hey Bro Code, will you be making videos on more advanced c++ topics(like this video,templates, move sematics,threads)?

  • @criminalx7099
    @criminalx7099 2 ปีที่แล้ว +2

    well explained bro

  • @Dazza_Doo
    @Dazza_Doo ปีที่แล้ว

    One of my all time FAV functions

  • @uniquecode-tech
    @uniquecode-tech 2 ปีที่แล้ว +1

    You're the best

  • @overki1l
    @overki1l 2 ปีที่แล้ว +1

    Thank you!

  • @geniusskills6151
    @geniusskills6151 2 ปีที่แล้ว

    you got yourself a new follower bro

  • @yellowhellow-wi9gi
    @yellowhellow-wi9gi 26 วันที่ผ่านมา

    thannks a lot

  • @Wlodzimierz123
    @Wlodzimierz123 2 ปีที่แล้ว

    Hi Bro! I noticed that you make very interesting movies, what language do you recommend at the beginning? Next year I have exams in page development, database writing (and c ++ currently doing) I'd love to learn to program, but I have a little problem with that
    Btw. Keep it up dude you're great :D :)

  • @sangitakumari5482
    @sangitakumari5482 2 ปีที่แล้ว +1

    Hey bro why don't you use the vs code screen cast mode it would be great so you could also use shortcuts and other stuff while it is shown on the screen. And also if you do make sure to set the screen cast (and something in between probably will be suggested) keyboard shortcuts only to true in the settings.json file so we won't see you every letter typing in the bar in which the shortcuts are shown

  • @AbCd-ck6qx
    @AbCd-ck6qx 2 ปีที่แล้ว +1

    First Like Comment ❤️

  • @Meta_Content
    @Meta_Content 2 ปีที่แล้ว +1

    Hey Bro, could you make a video about Bootstrap

  • @mgames3209
    @mgames3209 2 ปีที่แล้ว

    Oh cool

  • @user-xk7de1jw8g
    @user-xk7de1jw8g 10 หลายเดือนก่อน +1

    Bro, here's my assignment:
    // ternary operators ?: = replacement to an if-else statement
    // condition ? expression1 : expression 2
    #include
    /*
    int main()
    {

    int grade;
    std::cout > grade;

    if(grade > 40)
    {
    std::cout

  • @Adoof_3.0
    @Adoof_3.0 2 ปีที่แล้ว

    Can this be work with words? Like if opinion = yes then ()
    And opinion = no then ()

  • @AbCd-ck6qx
    @AbCd-ck6qx 2 ปีที่แล้ว +1

    first ❤️

  • @vivekpradhan8687
    @vivekpradhan8687 2 ปีที่แล้ว

    Hello! Sir,
    please help me to create a peace✌️sign using Java. Plz help

  • @nj5195
    @nj5195 2 ปีที่แล้ว +1

    According to you, the easier it is for me to start studying as a rookie. Java, or C++? I know HTML, CSS, but I don't find Javascript attractive to me.

    • @vinayaksingh524
      @vinayaksingh524 2 ปีที่แล้ว

      Java forces you to use OOP's and classes , you'll require a heavy ide and the jvm + jre + jdk just to say "hi".
      C++ has a lot of concepts to learn but OOP's is optional and it's your choice. C++ just needs any code editor and a compiler such as clang .

    • @vinayaksingh524
      @vinayaksingh524 2 ปีที่แล้ว

      Both languages are good at their own things, it's your choice. Either you write "public class public static void main string args system out println" and get stuck with nullpointerexception error in Java , or you can get used to " #include int main std cout " and fall in love with memory allocation in c++

    • @nj5195
      @nj5195 2 ปีที่แล้ว

      @@vinayaksingh524 so, c++?

    • @Awesometechgamer
      @Awesometechgamer ปีที่แล้ว +1

      Bro I also don’t find javascript That good the main thing is its weird. i would recommend you to learn C++ cuz it will teach you almost everything and you can catch any other language easily.

    • @nj5195
      @nj5195 ปีที่แล้ว

      @@Awesometechgamer thank you bro!

  • @c9gaming810
    @c9gaming810 2 ปีที่แล้ว

    hey you how to code chat and login in python

  • @sh.mh20
    @sh.mh20 ปีที่แล้ว +1

    Bro u can use [using namespace std;] instead of using std every time 🙂🙃

    • @BroCodez
      @BroCodez  ปีที่แล้ว +3

      true, but that's bad practice

    • @ahamedayyash1593
      @ahamedayyash1593 ปีที่แล้ว

      @@BroCodez why that is a bad practice?

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

      @@ahamedayyash1593 he explains in a previous video that std contains a lot of stuff, and you might want to use a name has been taken by std. (you can only use the name if you don't use "using namespace std;" )

    • @ahamedayyash1593
      @ahamedayyash1593 7 หลายเดือนก่อน

      @@Rehd66 okay thanks bro 🤜

  • @criminalx7099
    @criminalx7099 2 ปีที่แล้ว

    Ternary operator decreases the line of code.

  • @misaelsandoval7542
    @misaelsandoval7542 ปีที่แล้ว

    std::cout

  • @tunaan80
    @tunaan80 7 หลายเดือนก่อน

    ```cpp
    using namespace std;
    int celsius = 10;
    celsius > 0 ? cout

  • @nofall4263
    @nofall4263 ปีที่แล้ว

    #include
    int main(){
    double temp;
    std::cout temp;
    temp >= 50 ? std::cout

  • @dxwi
    @dxwi 2 ปีที่แล้ว +1

    McDonalds

  • @parpaperchimp
    @parpaperchimp 7 หลายเดือนก่อน

    Bool broken=true
    Broken =true?std::cout

  • @Darkknight-vw6ye
    @Darkknight-vw6ye ปีที่แล้ว

    #include
    int main()
    {
    // ternary operator ?: = replacement to an if/else statement
    // condition ? expression1 : expression2;
    int balance = 50;
    std::cout = 2000? "You are eligible to buy this product": "You don't have enough money") ;
    return 0;
    }

  • @NAKHODA_JALAL
    @NAKHODA_JALAL 3 หลายเดือนก่อน

    random comment

  • @tavares._art
    @tavares._art 11 หลายเดือนก่อน

    A ternary is used in some game mechanics involving status😊

  • @StrawdexGuy
    @StrawdexGuy 4 หลายเดือนก่อน

    pie

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

    #include
    int main () {
    bool carpenter == True;
    std::cout

  • @rfdave3980
    @rfdave3980 ปีที่แล้ว

    ( BRO ) ? std::cout

    • @hunin27
      @hunin27 10 หลายเดือนก่อน

      i love this sentence

  • @PaulSchneider-bp2ic
    @PaulSchneider-bp2ic 2 ปีที่แล้ว

    Could you please tell me what programming tools I need to learn so that I could code a program which will do the following:
    1.) Play the musical note which was assigned by me to each character of a text file, as it is "read" by an "appropriately coded program" or record those notes generated by the "appropriately coded program" to a MP3 file.
    For example:
    Given the text string, "B V G C T S L" , etc.,
    Letter Read........Actual Musical Tone generated
    B ........................ C4
    V ........................ D4
    G ........................ E4
    C ........................ F4
    T ........................ G4
    S ........................ A5
    L ........................ B5
    etc.,