Thanks! When I was writing a little todo list rest project, I was confused on why when there was a space in my string inputs, it would only use the first word inputted and make any following words apart of the next inputs in my loop.
@NikitaNair10 ай бұрын
Thank you!! I really needed this
@PortfolioCourses10 ай бұрын
You're welcome! BTW, you have a nice channel and a great singing voice! :-)
@laurenceflores9807 Жыл бұрын
so simple and easy to understand, thankyou sir have a nice life!
@SagarKumar-kf7eo2 жыл бұрын
Wow, sath sath m virat kohli ka promotion b hogya
@PortfolioCourses2 жыл бұрын
I'm not sure what that means Sagar. :-)
@rahulrai15302 жыл бұрын
@@PortfolioCourses He meant that, aside from us receiving some knowledge, Virat Kohli got some promotion as well.
@HiteshKumar-lu9wj3 күн бұрын
i was checking score of virat during video and suddenly you write virat kohli 😎😎
@yousaf20032 жыл бұрын
Congratulations 👏👏 on 9000 subscribers Keep it up 🔥
@PortfolioCourses2 жыл бұрын
Thank you very much Yousaf! 😀
@ramakrishna40922 жыл бұрын
congratulations sir for 9k sub ...
@PortfolioCourses2 жыл бұрын
Thank you Rama! :-)
@ramakrishna40922 жыл бұрын
@@PortfolioCourses hi sir I came across this question after seeing your video about extern I have a question suppose in my .h file I declare a global variable and linked to my main. c with the help of extern , is it possible to change the value in main .c file (which is declared in another file ) , if possible how to achieve this , it will be helpful to my studies if you do a video on this topic , thanks for helping and a quick response for your sub .... Thanks again sir...
@PortfolioCourses2 жыл бұрын
@@ramakrishna4092 Yes, we can change the value in main.c. This video should cover how to do this: kzbin.info/www/bejne/jaLQYqeJr9Kkobs. The example code is here: github.com/portfoliocourses/c-example-code/tree/main/extern_share_global_variable.
@Grandfather__ Жыл бұрын
You really helped me, man! If I'd be near to u, I'd hug u! Sry for typos, I am Russian. If u can, please, tell me about my mistakes!
@PortfolioCourses Жыл бұрын
Awesome, I'm glad the video helped you out! :-) Your English seems pretty good to me.
@ganeshmishraa Жыл бұрын
Amezing sir understand this concept very easily ❤🎉
@damarcuswilson110 ай бұрын
I notice the geline didn't work for me when there was a math equation statement that comes before it. When I switched it, it worked fine.
@mohanedalbkry89216 ай бұрын
thanks that will help me a lot
@sportgamer44828 ай бұрын
Are you a kohli fan?
@AlbeezyOfc Жыл бұрын
Goat
@PortfolioCourses Жыл бұрын
Thank you! :-)
@muhammadzaidmuckba9097 Жыл бұрын
@@PortfolioCourses not trying to be mean or rude but I guess he was calling Virat, Goat 😂
@PortfolioCourses Жыл бұрын
@@muhammadzaidmuckba9097 hahaha oh I bet you're right Muhammad, that's hilarious! 😂
@hafizsakib27342 жыл бұрын
sir, if we want to take input strings in multiple test cases ,it takes the enter as a string; currently I am handling it like this : int t; cin >> t; while(t--){ string s; char c; cin >> c; getline(cin, s); //example string : the devil in the sky ( I want to take it input as a single string) s = c + s; } //assume that I want to take the same string (the devil in the sky) 3 times,but while running the programme,it will take input 2 times because 1st time it take "enter" as a string(while we input the value 't' then enter) Is there any better approach ? I have heared about c++ ignore file or something like that but coudn't get it. please can you solve this problem ,please give me the answer as code... Thanks for reading,you are awssome!
@PortfolioCourses2 жыл бұрын
You should be able to use cin.ignore(), like right after cin>>t for example. This video may help: kzbin.info/www/bejne/nJTcmImqeb2UpK8. :-)
I think this is a good explanation here: stackoverflow.com/a/55308322. :-)
@ralphordiz6502 Жыл бұрын
getline doesnt work in codeblocks
@iJuMp8 Жыл бұрын
What do you use instead for CodeBlocks?
@naniguini2 жыл бұрын
Does anyone know how to solve this? I'm making a program that uses getline(cin, string), and even though it builds and runs without problem, it seems to skip this method and do the next steps.
@PortfolioCourses2 жыл бұрын
Hi Maria, have you tried clearing the input buffer? Sometimes that can help: kzbin.info/www/bejne/nJTcmImqeb2UpK8. 🙂
@naniguini2 жыл бұрын
@@PortfolioCourses Thank you very much, but it seems this method is not recognized by my IDE (Code::Blocks).
@PortfolioCourses2 жыл бұрын
Hmm, if it gives you an error message, you could google the error message to try to help. If it just doesn't work and has no error message, then maybe it's not solving the problem in your code. The code for that demo is here, I suspect it should work in Code::Blocks too as it is standard C++: github.com/portfoliocourses/cplusplus-example-code/blob/main/clear_input_buffer.cpp.
@naniguini2 жыл бұрын
@@PortfolioCourses I solved it, I had to use some libraries. Thank you👍👍