How to setup VS code for DSA and CP | Input / Output split format

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

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

  • @karanshah3818
    @karanshah3818 Год назад +333

    for windows users : it will not work if your default terminal is Powershell make it cmd then it will work.
    to change default terminal : press->clt+shift+p->write:default terminal->change it to cmd.

    • @AbjSir
      @AbjSir Год назад +54

      Brother mera ye option hi nhi aa rha h what should I do?
      ctrl shift p me ye wala option hi nhi aa rha
      EDIT : fix ho gaya
      for anyone facing same problem, go to terminal on top -> new terminal -> click on the down arraw button just besides the + button, there you can find select default profile then do what Karan has told above
      Thanks Karan for helping me, Was stuck on this for half an hour 😅😅

    • @karanshah3818
      @karanshah3818 Год назад +6

      @@AbjSir your welcome brother!

    • @avakashrajkonwar
      @avakashrajkonwar Год назад +3

      ​@@AbjSirbhai default terminal karke option nahi dikhara, power shell, git bash, command prompt ye sab dikharahe options me, kidar exactly click Karu?

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

      @@avakashrajkonwar Command propt hi cmd hota h bro

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

      @@AbjSir bhai mene select default profile pe click karke command prompt click Kia, lekin bro woh write:default terminal-> change it to cmd. Type kahape karu coz terminal me error dikharahe, CPP code bhi ruk karahu toh -1 se exit code ka error aarahe

  • @soumi6720
    @soumi6720 11 месяцев назад +28

    how is he so underrated? He has undoubtedly best coding content one can access for free in youtub

  • @shesparks64
    @shesparks64 Год назад +35

    This is really the best DSA course completely indepth ...insanely incredible

    • @rajeshr-0605
      @rajeshr-0605 Год назад +2

      In which video i watch to start DSA course?

    • @rajeshr-0605
      @rajeshr-0605 Год назад +2

      Are you finished DSA course?
      Can you reply quickly?

  • @sarathetanjul
    @sarathetanjul Год назад +44

    Great tip Striver bhaiya but those who don't want to do these much set-up they can just install one chrome extension "CPH for Competitive programmers" this extension will automatically access test case and run it for all test case in your VS code system.

  • @Akash-yr2if
    @Akash-yr2if Год назад +76

    After Solving 200+ Sheet question & Several Contest - This VS code installation is all we needed

    • @ImranOnTheWeb
      @ImranOnTheWeb 5 месяцев назад +1

      Which ide you used before

    • @Akash-yr2if
      @Akash-yr2if 5 месяцев назад +4

      @@ImranOnTheWeb Abb kuch nehi karta, wait karta hu

    • @rathore3991
      @rathore3991 3 месяца назад

      ​@@Akash-yr2ifkya karta ho bhai!

    • @Akash-yr2if
      @Akash-yr2if 3 месяца назад +1

      @@rathore3991 Abhi Job karta hu

    • @ashwin159
      @ashwin159 3 дня назад

      @@rathore3991 still waiting for his reply

  • @senseiAree
    @senseiAree Год назад +5

    Thanks a lot Striver for the LL videos in the A2Z DSA Series... really enjoying the videos. You're the GOAT

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

      I cannot see them. is LL playlist for members only ?

  • @ashmi1237
    @ashmi1237 Год назад +11

    Bhaiyya Thank you so much for your A2Z dsa sheet. I am a ECE 2023 graduate and i love coding I started my dsa journey 2 week ago but i am in stuck to do which kinds of problems do i need to do. There comes your your sheet. Even though i am doing dsa in python i have fundamentals in C++ so while you doing c++ i tried to do that code in python .So it is very beneficial for me to understand the language difference. Once again thank you so much. I have more way to go through your sheet . Please bless me 😊

    • @Jithendra-q6h
      @Jithendra-q6h 18 дней назад

      I got excited reading your story. I'm just starting the course. Do you have any suggestions for me?

    • @BEYOND_DEATH
      @BEYOND_DEATH 10 дней назад

      where are you placed now brother?

  • @ag2791
    @ag2791 Год назад +130

    For windows users whose path contains spaces will face issues.
    Just paste the below code , its the same code with a minute change in line "command"
    Here is the corrected code
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "compile",
    "type": "shell",
    "command": "g++",
    "args": [
    "-std=c++17",
    "-o",
    "${fileBasenameNoExtension}",
    "${file}"
    ],
    "group": {
    "kind": "build",
    "isDefault": false
    }
    },
    {
    "label": "compile and run",
    "type": "shell",
    "command": "g++ -std=c++17 -o \"${fileBasenameNoExtension}\" \"${file}\" && .\\${fileBasenameNoExtension} < input.txt > output.txt",
    "group": {
    "kind": "build",
    "isDefault": true
    }
    }
    ]
    }

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

      this helped me thanks!!

    • @Avenger-l3g
      @Avenger-l3g Год назад

      for java?

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

      @@Avenger-l3g bro u can ask to AI regarding this
      Ask either ChatGPT or Bard to convert this code for java

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

      Thanks Buddy It Worked 😍

    • @KendoBeats-yy3uy
      @KendoBeats-yy3uy Год назад +2

      This did help me out! Thanks!

  • @SaptadeepDutta_Ex-Xerox
    @SaptadeepDutta_Ex-Xerox 8 месяцев назад +9

    [IF ANYONE WANTS TO KNOW WHAT'S HAPPENING]
    This video is awesome! Just wanted to break down what's happening behind the scenes:
    The trick is to use tasks.json to redirect the default input stream to cin.
    Notice the command line options uses '' for output.txt. Those are actually compiler flags for g++!
    Super cool trick. 👍
    For reference, see the value of tasks[1]["command"] in tasks.json at line 22 visible at the 5:21 mark in the video.
    I am just adding context to the magic!
    Thanks again for sharing.

    • @garenafreefire1936
      @garenafreefire1936 7 месяцев назад +1

      I followed the steps as mentioned in the video but still i did not get the output

  • @garvnagpal3722
    @garvnagpal3722 26 дней назад +1

    Best series on youtube for DSA

  • @AndrewWang-ct8hm
    @AndrewWang-ct8hm 5 дней назад +1

    Really excited for this DSA series
    #Day1

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

    I belong to Python Community.
    Thankyou Stiver, know the life is sorted. I use to type multiple inputs by running code again and again.

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

      @@DEEKSHITH-bw6bo now I shifted to web development. But if you re-watch the complete video you will definitely find the solution to your problem.

    • @ImranOnTheWeb
      @ImranOnTheWeb 5 месяцев назад

      Are you a college Student or doing job?

    • @studynewthings1727
      @studynewthings1727 5 месяцев назад

      @@ImranOnTheWeb I am the college student.

    • @ImranOnTheWeb
      @ImranOnTheWeb 5 месяцев назад

      @@studynewthings1727 which year brother

  • @BiswajitDas-fj5gp
    @BiswajitDas-fj5gp Год назад +4

    I am so much grateful to you for this video. I want it for the last few days.
    Many many many thanks.🥰🥰🥰🙏

  • @VatsalJain-jp5ux
    @VatsalJain-jp5ux Год назад +15

    Bhaiya I'm in my 2nd year of college and its a tier 3 one , so most of us students depend on your DSA videos ..
    bhaiya we are really really respectful and grateful to you for your service ... And hope you will continue to do your best in everything 👍👍👍
    bhaiya I wanted to ask that when will you be uploading the articles attached with the questions provided and Videos which are pending right now ?? Like is there a 1 week uploading thing or something ??
    please reply to this comment coz many of us are waiting for the answer.
    If any viewers or Bhaiya yourself find this rude then I'm very very sorry ... coz I know that working + making videos is hectic work but just asking coz many of us dont know

    • @ADITYA_138
      @ADITYA_138 10 месяцев назад

      Isme c++ bhi padhya hai na ? Pls tell? Merko c++ 0 aya hai basic se karya hai na?

    • @SauravSingh-xm6nn
      @SauravSingh-xm6nn 8 месяцев назад

      ham tier 1 wale ko v jaroorat pdti hai bhai

  • @Roheswaran.S
    @Roheswaran.S 14 дней назад

    Thank You is not enough for you , You are the Real meaning of Striver!

  • @KoushikDasMagnate2005
    @KoushikDasMagnate2005 Год назад +3

    Thanks Striver for sharing this ! It was of great help .

  • @PrithaMajumder
    @PrithaMajumder 10 месяцев назад +1

    Thanks a lot, Raj for This Amazing Lecture... 🙂

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

    00:04 Setting up VS code for DSA and CP
    01:07 Setting up VS code for C++
    02:11 Setting up VS code for DSA and CP
    03:22 Build a strong portfolio with projects and DS algo for placements.
    04:24 Setup VS code for DSA and CP
    05:31 Setting up VS code for DSA and CP is easy.
    06:40 Set up VS code for DSA and CP
    07:53 Setting up VS code for DSA and CP

  • @S3aw0lf
    @S3aw0lf Год назад +7

    I was setting up VSCode just yesterday and faced difficulty omg and this vid comes out today ❤

  • @6.squash.936
    @6.squash.936 Год назад +20

    Thank you Striver for making this course Language Independent , I am following the course in JavaScript only problem I have is that sometimes the codeStudio links you provide the platform doesn't have a Javascript Compiler but LeetCode has but anyways I code on Vscode now.

    • @takeUforward
      @takeUforward  Год назад +7

      Getting it fixed soon

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

      hey, i am also starting with js as well. Any guide or any other resource which will be better. Please share

    • @okkk-gt8tb
      @okkk-gt8tb 5 месяцев назад

      @@mod_cyber1015 hey,any resources you got in js ?

  • @abhinavpandey840
    @abhinavpandey840 8 месяцев назад +29

    The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command g++ -std=c++17 -o "demo" "C:\Users\Dell\OneDrive\C++\demo.cpp" && .\demo < input.txt > output.txt" terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.
    Those who are getting this type of problem , you are doing a mistake as you are running in windows powershell terminal and not in command prompt terminal and in new version of vs code you cannot change your default terminal as shown by other youtubers, for changing try following this steps:
    1: Go to setting icon of vs code in lower left corner.
    2: Go to setting option (where shortcut is showing ctrl+,).
    3:search for default terminal.
    4: here select the *default terminal profile for Windows* and change it to command prompt.
    *NOTE* : You need to change from workspace (it is just below the search bar where you had type default terminal) ,if you change from user side it will not change ,also it was the error from the beginning because you were changing default terminal from the user side and not the workspace side

    • @akshaybhardwaj7096
      @akshaybhardwaj7096 8 месяцев назад +3

      bro even after doin this i am getting this again- * Executing task: g++ -std=c++17 -o "demo" "C:\Users\HP\Desktop\C++\demo.cpp" && .\demo < input.txt > output.txt
      'g++' is not recognized as an internal or external command,
      operable program or batch file.
      * The terminal process "C:\WINDOWS\System32\cmd.exe /d /c g++ -std=c++17 -o "demo" "C:\Users\HP\Desktop\C++\demo.cpp" && .\demo < input.txt > output.txt" terminated with exit code: 1.
      * Terminal will be reused by tasks, press any key to close it.

    • @ayushpandey4013
      @ayushpandey4013 8 месяцев назад +1

      It's showing that
      The syntax of the command is incorrect

    • @C0medyKing
      @C0medyKing 7 месяцев назад

      @@akshaybhardwaj7096 i also face the same problem , can anyone gave me the right solution

    • @garenafreefire1936
      @garenafreefire1936 7 месяцев назад

      Pls help its showing like this
      Executing task: copy "C:\Users\PRANAV\Desktop\demoo\.vscode\tasks.json" C:\Users\PRANAV\Desktop\demoo\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp
      1 file(s) copied.
      jspwTest.cpp:1:1: error: expected unqualified-id before '{' token
      {
      ^
      * The terminal process "C:\windows\System32\cmd.exe /d /c copy "C:\Users\PRANAV\Desktop\demoo\.vscode\tasks.json" C:\Users\PRANAV\Desktop\demoo\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp" terminated with exit code: 1.
      * Terminal will be reused by tasks, press any key to close it.

    • @vanishjain2975
      @vanishjain2975 6 месяцев назад

      Thanks bro , it Worked!!

  • @AnonymousHacker-gw8pn
    @AnonymousHacker-gw8pn 10 месяцев назад +8

    c++ setup not working for windows, getting "The syntax of the command is incorrect."

  • @omkarmandal8138
    @omkarmandal8138 6 месяцев назад +3

    Review: Too Good to be free. This Man is Educating India for free.

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

    Most awaited video. Thank you Bhaiya !!

  • @Noob_Driverr
    @Noob_Driverr 2 месяца назад +2

    So, yeah for me, it wasn't as simple as that but the AI ChatGPT, helped a lot.
    In my case, the code was compiling and running if both are done separately, Ctrl + Shift + B compiled the program and Ctrl+Shift+P > Run tasks > Run with input or output used to put the output in Output.txt.
    ChatGPT said the following steps, will work according to the case that C++ file is main.cpp ,input file is input.txt ,and output file is output.txt
    1. Create the file build_and_run.bat and write the prompt in it
    @echo off
    g++ main.cpp -o main.exe
    main.exe < input.txt > output.txt
    2. Next, change the json prompt to the following:
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "Compile and Run with Input and Output",
    "type": "shell",
    "command": "${workspaceFolder}\\build_and_run.bat",
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "detail": "Compiles and runs the program with input redirection and writes output to output.txt"
    }
    ]
    }
    The next time you use Ctrl + Shift + B, it will compile and run too.
    Hope it helps 👍

  • @confident_winner
    @confident_winner Месяц назад +2

    5:09 I don't have the "Create tasks.json file from template." option. Any fix?
    Edit: I found the solution, there is a direct file tasks.json in the .vscode file. Just show hidden files and you will find it.

  • @arjunflix
    @arjunflix Год назад +10

    Replace the following line "${workspaceFolder}\\jspwTest.cpp", with "\"${workspaceFolder}\\jspwTest.cpp\"", if output is not generating

    • @milindchaturvedi9770
      @milindchaturvedi9770 11 месяцев назад

      WORKS ! DAMN thanks so much

    • @gada.shreebh
      @gada.shreebh 10 месяцев назад

      Thanks a lot. Working just like that.

    • @_Phanindrak_
      @_Phanindrak_ 10 месяцев назад +1

      Not working pls help

    • @gada.shreebh
      @gada.shreebh 10 месяцев назад +1

      ​​@@_Phanindrak_ see the pinned comment in this video, for windows user make the default terminal to cmd

    • @_Phanindrak_
      @_Phanindrak_ 10 месяцев назад

      @@gada.shreebh i did it but output is not comping pls help

  • @thefourhourtalk
    @thefourhourtalk Год назад +3

    after almost wasting 50 hours on dsa in youtube I got you sir your explanation was just wowwww

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

    this is what i was searching for.....thanku bayya

  • @anuragk10
    @anuragk10 6 месяцев назад

    Kindly solve this problem when i run this code at timeline - 5:40. Executing task: g++ -std=c++17 -o demo
    g++: fatal error: no input files
    compilation terminated.
    * The terminal process "C:\windows\System32\cmd.exe /d /c g++ -std=c++17 -o demo" terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

  • @Engineeringgod-z4h
    @Engineeringgod-z4h 8 дней назад +1

    am i going to get the error message from the code like runtime aur compile time error message

  • @shivaay3549
    @shivaay3549 3 месяца назад +3

    05:20 Where is the configuration code ? Can anyone provide me that ?

    • @negigarv8298
      @negigarv8298 2 месяца назад

      {
      "version": "2.0.0",
      "tasks": [
      {
      "label": "Compile and run",
      "type": "shell",
      "command": "",
      "args": [
      "copy",
      "\"${file}\"",
      "${workspaceFolder}\\jspwTest.cpp",
      "&&",
      "g++",
      "jspwTest.cpp",
      "-o",
      "jspwTest",
      "&&",
      "jspwTest",
      "",
      "output.txt",
      "&&",
      "del",
      "jspwTest.exe",
      "&&",
      "del",
      "jspwTest.cpp"
      ],
      "presentation": {
      "reveal": "never"
      },
      "group": {
      "kind": "build",
      "isDefault": true,
      },
      "problemMatcher": {
      "owner": "cpp",
      "fileLocation": [
      "relative",
      "${workspaceRoot}"
      ],
      "pattern": {
      "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
      "file": 1,
      "line": 2,
      "column": 3,
      "severity": 4,
      "message": 5
      }
      }
      }
      ]
      }

    • @negigarv8298
      @negigarv8298 2 месяца назад

      Take it

  • @ultimatescience3842
    @ultimatescience3842 Год назад +13

    Are the videos arranged in a sequential manner in A2Z playlist?
    I am learning c++ right now and will be doing dsa from your playlist.
    Also, when will that course be completed?

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

      Yes, it's in sequence. You will find everything topic-wise.

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

      ​@@iamritam
      Bro can you please tell me how much he has covered till now?
      And what percentage of the course is still left?

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

      @@ultimatescience3842 In his current updated playlists he has covered till Binary Search hard, there are video solutions for advanced topics as well, from his old videos.

  • @YogisInsights
    @YogisInsights 5 месяцев назад +3

    Note: It is checked verified method still if there is any minute trouble do ask me or ChatGPT like ai tools.
    Day 1: Introduction to DSA and Environment Setup
    Download the vs code required extensions then set-up your ide
    Day 1: Setting Up Your IDE Like a Pro
    Introduction
    When starting your coding journey, having an organized environment can significantly boost your productivity and ease the debugging process. Today, we’ll walk you through setting up your IDE using a JSON file to manage your coding files, input, and output separately. We’ll cover setups for Java, C++, and Python.
    Step 1: Why Use a JSON File?
    Using a JSON file to organize your projects helps in keeping your code, input, and output files separate, making it easier to manage and test your programs. It also allows for easy switching between different languages and projects.
    Step 2: Creating Your Project Structure (It can vary on every individual this is just an example)
    First, let’s create a directory structure:
    bash
    Copy code
    /my_project
    ├── code/
    │ ├── main.cpp (or main.java, main.py)
    ├── input/
    │ ├── input.txt
    ├── output/
    │ ├── output.txt
    ├── config.json
    • code/: This folder contains your main source code file.
    • input/: Place your input files here.
    • output/: Your program’s output will be stored here.
    • config.json: This file will manage the paths and commands for running your program.
    Step 3: Writing the JSON Configuration
    Note : for windows users : it will not work if your default terminal is Powershell make it cmd then it will work. to change default terminal : press->clt+shift+p->write:default terminal->change it to cmd
    Create a config.json file in your project directory.
    C++ :
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "Compile and run C++",
    "type": "shell",
    "command": "g++",
    "args": [
    "-std=c++17",
    "-O2",
    "${file}",
    "-o",
    "${fileDirname}\\${fileBasenameNoExtension}.exe",
    "&&",
    "${fileDirname}\\${fileBasenameNoExtension}.exe",
    "",
    "output.txt",
    "&&",
    "del",
    "${fileDirname}\\${fileBasenameNoExtension}.exe"
    ],
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": ["$gcc"]
    }
    ]
    }
    For Java:
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "Compile and run Java",
    "type": "shell",
    "command": "javac",
    "args": [
    "${file}",
    "&&",
    "java",
    "-cp",
    "${fileDirname}",
    "${fileBasenameNoExtension}",
    "",
    "output.txt"
    ],
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": ["$javac"]
    }
    ]
    }
    Python:
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "Run Python",
    "type": "shell",
    "command": "python",
    "args": [
    "${file}",
    "",
    "output.txt"
    ],
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": ["$python"]
    }
    ]
    }
    These configurations will work for their respective languages, using input.txt for input and writing to output.txt for output.
    Conclusion
    With this setup, you’ll have a neatly organized workspace where your code, input, and output are separated, making testing and debugging your programs easier. This structure is a best practice for professionals.

  • @tamalmazumder8476
    @tamalmazumder8476 Месяц назад

    Thanks!!! Working like a Charm

  • @slighty5879
    @slighty5879 7 месяцев назад +17

    *OUTPUT NOT PRINTING ISSUE FIX IN WINDOWS*
    Step 1:
    Replace the following line "${workspaceFolder}\\jspwTest.cpp", with "\"${workspaceFolder}\\jspwTest.cpp\"",
    Step 2:
    1: Go to setting icon of vs code in lower left corner.
    2: Go to setting option (where shortcut is showing ctrl+,).
    3:search for default terminal.
    4: here select the default terminal profile for Windows and change it to command prompt.

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

    Very nice explanation,God Bless You

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

    Sir I completed the setup but when I run the code jspwtest.cpp file occurs and output does not come. How to resolve this?? Please someone suggest

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

    Thanks for sharing your knowledge buddy. 😊

  • @vaishnavi_346
    @vaishnavi_346 5 месяцев назад +2

    Hi, i had setup my vs code for c++ seeing your video for it, i have a few doubts: now my normal run code button doesnt run in cases where i need to give an input, secondly everytime for an output i have to write ctrl+shift+b?

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

    Thanks for such informative videos

  • @princechourasia3893
    @princechourasia3893 Месяц назад

    you are awesome.....loved your videos

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

    Bhai thank u very much for this video 😊😊

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

    thanks a lot striver, really helpful for me

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

    when i press Ctrl + shift + B nothing happens ? what could be the reason?

  • @mayurtummewar3312
    @mayurtummewar3312 10 месяцев назад +2

    This works for Ubuntu too 🥳

    • @venom3380
      @venom3380 2 дня назад

      what did u chose for ubuntu mac or windows config?

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

    I use windows 11. I have followed all the steps. But upon pressing ctrl+shift+b i get :" command syntex error" message in the terminal and bothing in output file. How can I fix it?

  • @harshtripathi-ql8yx
    @harshtripathi-ql8yx Год назад +3

    Please make the strings playlist as soon as possible.

  • @devanshsinghind
    @devanshsinghind 5 дней назад

    my mac does not have bits/stdc++.h how to add that??

  • @Chuchuchal
    @Chuchuchal 7 дней назад

    finally done hogaya 1st class hii adventure sei bara tha 😅
    guys if you facing problem then simply say chech discription and read cearfully then you do thar

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

    bhaiya plz upload next series , eagerly waiting for linked list , greedy etc

  • @rz_rabbi
    @rz_rabbi 11 месяцев назад +1

    When I press ctrl+shift+B it showing me an error in jspwTest.cpp file. Error message: expected unqualified-id before numeric constant [Ln 1, Col 1].. expected a declaration C/C++(169) [Ln 1, Col 1]. Any solution?

    • @aspiringcodess
      @aspiringcodess 5 месяцев назад

      Same here, did it get resolve?

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

    Bhaisaab this video was so important 🥹🥹🥹🥹

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

    This is not working for c++ if i am reopening the c++ folder in vscode, it asks to select a build task to run , but even after selecting it does not work.The output does NOT change.

  • @aryankhare4031
    @aryankhare4031 7 дней назад

    terminal open up even aftr cmd + shift + b
    what can be done for this?

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

    Bahi apka A to Z series playlist kab tak khatam ho jayega
    Please playlist ko acche se sequence me thoda ready karna.
    Please respond me.

  • @dhamotz4737
    @dhamotz4737 8 месяцев назад +1

    i did the exactly same thing guys as told for mac but the bits extension file is showing erroe in my mac while running can someone tell me what I have done wrong?

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

    can someone help me I am getting this error "The syntax of the command is incorrect." in the terminal and I am not able to get any output in output.txt

    • @balu_zoro
      @balu_zoro 10 месяцев назад

      in tasks.json , under "tasks" then under "args" " the first text is set to "python3" i have removed the 3 and just made it "python" . then , its working for me

  • @radhekrishna2477
    @radhekrishna2477 11 месяцев назад +2

    i am starting today , let me see how much does it take to reach codeforces 2000 rating

  • @anurag_ad_01
    @anurag_ad_01 Год назад +5

    getting this error pleaase help
    * Executing task: copy "C:\Users\anura\Desktop\C++\demo.cpp" C:\Users\anura\Desktop\C++\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp
    The syntax of the command is incorrect.
    * The terminal process "C:\WINDOWS\System32\cmd.exe /d /c copy "C:\Users\anura\Desktop\C++\demo.cpp" C:\Users\anura\Desktop\C++\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp" terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

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

      same

    • @vineetsingh3985
      @vineetsingh3985 10 месяцев назад +1

      Try this tasks.json(C++):
      {
      "version": "2.0.0",
      "tasks": [
      {
      "label": "Compile and run",
      "type": "shell",
      "command": "",
      "args": [
      "copy",
      "\"${file}\"",
      "\"${workspaceFolder}\\jspwTest.cpp\"",
      "&&",
      "g++",
      "jspwTest.cpp",
      "-o",
      "jspwTest",
      "&&",
      "jspwTest",
      "",
      "output.txt",
      "&&",
      "del",
      "jspwTest.exe",
      "&&",
      "del",
      "jspwTest.cpp"
      ],
      "presentation": {
      "reveal": "never"
      },
      "group": {
      "kind": "build",
      "isDefault": true,
      },
      "problemMatcher": {
      "owner": "cpp",
      "fileLocation": [
      "relative",
      "${workspaceRoot}"
      ],
      "pattern": {
      "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
      "file": 1,
      "line": 2,
      "column": 3,
      "severity": 4,
      "message": 5
      }
      }
      }
      ]
      }

  • @_anujKaushik_
    @_anujKaushik_ 6 месяцев назад +2

    Thanks Raj bhaiya for this configuration file, it is working completely fine with some minor modification using chatgpt. But it stuck when I accidentally execute infinite loop. Can you tell how to add time limit for execution similarly like we have on competitive platforms.

    • @sadiquereyaz
      @sadiquereyaz 6 месяцев назад

      bro please reply when you'll get the solution.

  • @vinaysalve8009
    @vinaysalve8009 Год назад +5

    I am getting this error :
    * Executing task: copy "C:\Users\vinay\Documents\C++
    ew.cpp" C:\Users\vinay\Documents\C++\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp
    ParserError:
    Line |
    1 | … ++\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.t …
    | ~
    | The '

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

      same

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

      same bro
      @@shydcuk

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

      in windows it will not work if your default terminal is powershell make it cmd then it will work.

    • @Bimplo-l6f
      @Bimplo-l6f Год назад +1

      ​@@karanshah3818but it is still not working it is showing building for 10 min
      Did you do any changes in the code

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

      @@Bimplo-l6f i also faced this problem then i restarted vs code and it was working properly.

  • @VENUGOPALRAO-w8g
    @VENUGOPALRAO-w8g Год назад +2

    great video, is there any way to change the shortcut to run the code to something else?

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

      Yes there is
      Go to keyboard shortcuts and search the shortcut which is already there I think ctrl shift p it is so search that shortcut, like just search ctrl shift p and change it to whatever you want
      I have changed it to Alt + X

    • @VENUGOPALRAO-w8g
      @VENUGOPALRAO-w8g Год назад +1

      @@AbjSir thanks, i got it now

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

    Where's that a2z course? There's no link in the description for that? 2:01

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

    if facing errpr while running the java file, go to tasks.json and change label a liitle bit ...suppose Compile and Run. In my case, it worked after doing this, earlier the cpp task file was always getting run in java also.

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

    Not working in my laptop (macbook). I hv tried multiple times. Also tried to modify the task accordingly using ChatGPT but didn't work. Unable to find the reason

    • @rajkumarchaudhary6783
      @rajkumarchaudhary6783 7 месяцев назад

      did you get any solution yet ?

    • @superiors2817
      @superiors2817 7 месяцев назад +1

      @@rajkumarchaudhary6783 yes brother, working fine
      basically i used the same template as provided, just insure that the path in which you have saved the folder or your cpp file, make sure the name of any folder should not contain spaces. For eg. if you have a folder named "abc def" make it "abc_def", that was the mistake i was doing, maybe helpful for you

  • @sauravraj2831
    @sauravraj2831 Год назад +14

    Thanks Striver 🙌
    For C++ & JAVA
    was facing some errors of syntax in tas.json file on windows. Pasting working json
    This will dynamically take the file that is active and you are working and run that.
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "Compile and run",
    "type": "shell",
    "command": "cmd",
    "args": [
    "/C",
    "g++ \"${file}\" -o \"${fileDirname}\\${fileBasenameNoExtension}\" && \"${fileDirname}\\${fileBasenameNoExtension}\" < \"${workspaceFolder}\\input.txt\" > \"${workspaceFolder}\\output.txt\""
    ],
    "presentation": {
    "reveal": "never"
    },
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": {
    "owner": "cpp",
    "fileLocation": [
    "relative",
    "${workspaceRoot}"
    ],
    "pattern": {
    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
    "file": 1,
    "line": 2,
    "column": 3,
    "severity": 4,
    "message": 5
    }
    }
    }
    ]
    }
    For those who want the same configuration for JAVA
    Make sure you have jdk installed and added in path
    {
    "version": "2.0.0",
    "tasks": [
    {
    "label": "Compile and run Java",
    "type": "shell",
    "command": "cmd",
    "args": [
    "/C",
    "javac \"${file}\" && java -cp \"${fileDirname}\" \"${fileBasenameNoExtension}\" < \"${workspaceFolder}\\input.txt\" > \"${workspaceFolder}\\output.txt\""
    ],
    "presentation": {
    "reveal": "always"
    },
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": {
    "owner": "java",
    "fileLocation": [
    "absolute"
    ],
    "pattern": {
    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
    "file": 1,
    "line": 2,
    "column": 3,
    "severity": 4,
    "message": 5
    }
    }
    }
    ]
    }

    • @AyushKumar-xi8hd
      @AyushKumar-xi8hd Год назад

      Thanks a lot for helping ❤

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

      Thanks a lot for helping

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

      Thank you so much for this

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

      For some reason there is no tasks.json file in the description and also, the json config provided in striver's website is not working however I tried this json and it is working fine. Thanks for helping out. If anyone is struggling to setup can reply me I have fixed hell lot of stuff for this setup.

    • @armansingh.23
      @armansingh.23 11 месяцев назад

      @@sheikhtahamaroof8484 the configuration given by Striver is not working for me. What should I do?

  • @siby-tu6bj
    @siby-tu6bj 3 месяца назад

    okay my output prints hey but my input 13 is not showing in output whats the reason?

  • @jainamsonigara8734
    @jainamsonigara8734 2 месяца назад

    do we need to everytime press ctrl+shift+b or can you do that with just run button

  • @Tanishq_1803
    @Tanishq_1803 4 месяца назад +1

    5:22 where is this code

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

    Hi, Can anyone paste the task.json (C++) code for Windows, the one on the website doesn't work for me.

    • @vineetsingh3985
      @vineetsingh3985 10 месяцев назад

      try this one it is working:
      {
      "version": "2.0.0",
      "tasks": [
      {
      "label": "Compile and run",
      "type": "shell",
      "command": "",
      "args": [
      "copy",
      "\"${file}\"",
      "\"${workspaceFolder}\\jspwTest.cpp\"",
      "&&",
      "g++",
      "jspwTest.cpp",
      "-o",
      "jspwTest",
      "&&",
      "jspwTest",
      "",
      "output.txt",
      "&&",
      "del",
      "jspwTest.exe",
      "&&",
      "del",
      "jspwTest.cpp"
      ],
      "presentation": {
      "reveal": "never"
      },
      "group": {
      "kind": "build",
      "isDefault": true,
      },
      "problemMatcher": {
      "owner": "cpp",
      "fileLocation": [
      "relative",
      "${workspaceRoot}"
      ],
      "pattern": {
      "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
      "file": 1,
      "line": 2,
      "column": 3,
      "severity": 4,
      "message": 5
      }
      }
      }
      ]
      }

  • @hiteshbhartia734
    @hiteshbhartia734 9 месяцев назад +1

    I am having issues in setting up vs code. The output is coming in the terminal of vs code instead of the txt file I created. Can anyone help me with it.

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

    ld: file too small (length=1) file '/Users/ujjwalagrawal/Desktop/cpp/input.txt' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation). having this error in my mac setting the above setting can you explain, i tried evrything ...chatgpt also but culdnt understand...

  • @averylazyandweirdhuman
    @averylazyandweirdhuman 7 месяцев назад

    Striver, I am really slow while dry running the code and building the intuition. how can I improve that? How to think about edge cases?

  • @akhilesh33056
    @akhilesh33056 5 месяцев назад +1

    If you aren't findind that .json code in description, click on one of the links in description, there you will find it.

  • @ChandraShekar-gu9ul
    @ChandraShekar-gu9ul Год назад +1

    Not working for my windows giving
    error : The token '&&' is not a valid statement separator in this version

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

    After pressing run it gives "demo.exe file does not exit". What changes should I make in my launch.json file to get the output???

  • @hardiksaxena7921
    @hardiksaxena7921 8 месяцев назад +1

    Sir I can't show output. Ctrl+shift+b is not working.

  • @rishidakoria9608
    @rishidakoria9608 8 месяцев назад +1

    i use ubuntu and its not working. i used chat gpt changed task.json file but still shows output in terminal but not in output file, also does not take input from input file

  • @miteshrajpurohit9033
    @miteshrajpurohit9033 3 месяца назад

    i followed the same procedure after the ctrl+shift+built therer is two JspwTest.cpp and JspwTest.exe and hellowolrd.exe file is created but the output is not showing . my code is written in the helloworld.cpp please help me on it and i choose cmd as command prompt but i am unable to fix it please help on it

    • @AnishaSharma-f5w
      @AnishaSharma-f5w Месяц назад

      i have the same problem bro pls help me if you have already done

  • @shravani_gulhane
    @shravani_gulhane 2 месяца назад

    Tried doing for java but the output is shown on terminal but not output.txt I used tasks.json code provided in link for windows

  • @AnkitChaudhary-zx1ob
    @AnkitChaudhary-zx1ob 9 месяцев назад +1

    how to stop exection when i stuck into a infinite loop??

  • @felucia.
    @felucia. Год назад +2

    Thanks brother :)

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

    Glad that it worked with a little help from gpt too.

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

    I am having a small issue with the TUF website. The problems that I mark as "done" are not saved. When I reload the page or access it from another device, the updates are not reflected. Is it with everyone ?

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

    We can also install the competitve programming helper extension

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

    on my Mac, when i click on terminal, then configure task, after that i can't the option of 'Create tasks.json file from template', what to do now?

  • @guiltowner4605
    @guiltowner4605 11 месяцев назад

    Showing : The syntax of the command is incorrect. what should i do?

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

    Great work

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

    hi need help figuring out that i followed each and every step very carefully but still i get errors like the code ended with error and so on and i really cannot figure out anymore how to resolve the issue also there appeared to be no errors in the problems section this is the error that i get : The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command g++ -std=c++17 -o "demo" "C:\Users\Dell\OneDrive\C++\demo.cpp" && .\demo < input.txt > output.txt" terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.
    would appreciate any guidance

    • @Goutam-tr2ls
      @Goutam-tr2ls 9 месяцев назад

      I'm also having similar problem
      😢

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

      you are doing a mistake as you are running in windows powershell terminal and not in command prompt terminal and in new version of vs code you cannot change your default terminal as shown by other youtubers, for changing try following this steps:
      1: Go to setting icon of vs code in lower left corner.
      2: Go to setting option (where shortcut is showing ctrl+,).
      3:search for default terminal.
      4: here select the default terminal profile for Windows and change it to command prompt.
      NOTE : You need to change from workspace (it is just below the search bar where you had type default terminal) ,if you change from user side it will not change ,also it was the error from the beginning because you were changing default terminal from the user side and not the workspace side

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

      i can tell you are running in powershell terminal because it is written in your path C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe (see you are running in powershell.exe) if you were ran this code in command prompt it had shown cmd.exe and striver bhaiya already said you have to run in command prompt terminal for working and not in powershell terminal

    • @garenafreefire1936
      @garenafreefire1936 7 месяцев назад

      ​@@abhinavpandey840pls tell what to do
      Executing task: copy "C:\Users\PRANAV\Desktop\demoo\.vscode\tasks.json" C:\Users\PRANAV\Desktop\demoo\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp
      1 file(s) copied.
      jspwTest.cpp:1:1: error: expected unqualified-id before '{' token
      {
      ^
      * The terminal process "C:\windows\System32\cmd.exe /d /c copy "C:\Users\PRANAV\Desktop\demoo\.vscode\tasks.json" C:\Users\PRANAV\Desktop\demoo\jspwTest.cpp && g++ jspwTest.cpp -o jspwTest && jspwTest < input.txt > output.txt && del jspwTest.exe && del jspwTest.cpp" terminated with exit code: 1.
      * Terminal will be reused by tasks, press any key to close it.

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

    oh my god i wanted this so much

  • @harshrkaushik
    @harshrkaushik 5 месяцев назад

    My input txt and output txt are integrated after i asked gpt for modified task.json but every time i have to press ctrl shift B for output updation can it be automated

  • @aayushrajpurohit321
    @aayushrajpurohit321 10 месяцев назад

    Why am I getting error after making changes in .json file, I am getting correct output but when I press Ctrl Shift B I get some error in compile and run.

    • @AnkitPatel-zc5yf
      @AnkitPatel-zc5yf 10 месяцев назад

      try this out
      {
      "version": "2.0.0",
      "tasks": [
      {
      "label": "Compile and run",
      "type": "shell",
      "command": "cmd",
      "args": [
      "/C",
      "copy \"${file}\" \"${workspaceFolder}\\jspwTest.cpp\" && g++ \"${workspaceFolder}\\jspwTest.cpp\" -o \"${workspaceFolder}\\jspwTest\" && \"${workspaceFolder}\\jspwTest.exe\" < input.txt > output.txt && del \"${workspaceFolder}\\jspwTest.exe\" && del \"${workspaceFolder}\\jspwTest.cpp\""
      ],
      "presentation": {
      "reveal": "never"
      },
      "group": {
      "kind": "build",
      "isDefault": true
      },
      "problemMatcher": {
      "owner": "cpp",
      "fileLocation": [
      "relative",
      "${workspaceRoot}"
      ],
      "pattern": {
      "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
      "file": 1,
      "line": 2,
      "column": 3,
      "severity": 4,
      "message": 5
      }
      }
      }
      ]
      }

  • @-SripathiNamrathaa
    @-SripathiNamrathaa 9 месяцев назад

    task.json code for javascript link was not provided in the description will you please provide it.

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

      It's in the website link.

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

    Striver please make a playlist for STRINGS also.

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

    Heeeeeey Striver, thank you 💝

  • @User-i6v2g
    @User-i6v2g Год назад +2

    Is java certifition exam (OCJP) is important?? Please make one video on it

  • @RudraKumarSharma-u9s
    @RudraKumarSharma-u9s 6 месяцев назад

    this setup is not working for me as a mac user idk why it just dont ask input and just print some random set of integers please someone help

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

    FOR MACBOOK, it'a not working: Exception in thread "main" java.util.NoSuchElementException
    at java.base/java.util.Scanner.throwFor(Scanner.java:945)
    at java.base/java.util.Scanner.next(Scanner.java:1602)
    at java.base.....
    The terminal process "/bin/zsh '-l', '-c', 'javac /Users/xxxxxxx/L4_Problems.java && java L4_Problems < input.txt > output.txt'" terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

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

    great tip bhaiya.