📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time.
i enrolled myself in an oop course at my school without knowing almost anything about programming and your videos have been helping me a lot, thank you so much.
Lady, you are doing a very great job. I am doing a home self study in C++ and web development, as I can't afford to go to college. I have almost every essential C++ and web development books. And I came to know about your videos just two weeks ago. You have really helped me a lot... Thanks a lot! Daniel from Zambia.
One thing you should have mentioned is that system("pause>0) creates a file on the default folder (debug by default in VS) without an extension. The file is simply called 0 because that is what you asked the system to do. you can use anything instead of 0. For example you can say: pause>test then it will create a file called test with the words "Press any key to continue . . . ". The other command I sometimes use is system("cls"); this clears the screen before output so the statement is the first one in a program. Of course this is all good for console applications. For GUI it is never used. Have you thought of doing videos for C# Thanks and keep up with the good work. Where exactly are you teaching computing. Which country. you don't have to name your university if you don't want to.
Thanks for this useful comment! I'm planing to do C# tutorials, and as soon as I free up some time, I'll start ☺️ Regarding the University, I have completed Bachelor Degree at Faculty of Information Technologies, University "Džemal Bijedić" in Mostar, with 9.2/10 grade 🎓😁 I used to work as a teacher, but I'm currently teaching only for fun on RUclips, and working 9-5 as a programmer in a company called EVONA 🤗🤗
@@CodeBeauty Thank you for responding to me. You are a really cleaver girl I can see and very dedicated in your work. you can keep in touch with me. I live and work in London, UK and computing is just a hobby for me. My main job is Accounting and Tax. i did BSc in Mathematics, Computing and statistics at University of London so I know some C, C++, HTML/CSS/JavaScript and C#. Some Delphi as well. Kind regards and I'll keep watching your videos regualrly.
Another way to prevent the window from closing in debug mode in the IDE is Debug > options > general tab (left side) > scroll down to and uncheck "Automatically close the console when debugging stops".
there's a 4th option : by going to Tools -> Options -> Debugging : and disable "Automatically close the console when debugging stops". I guess that this is the from the best ways to do it, and i almost forgot, big thanks and regards Nurak Saldina, for this video.
@CodeBeauty I've found another way to do it. It's a built-in option in VStudio 2019. Go to Tools > Options > Debugging > General. Scroll down and uncheck the box saying, "Automatically close the console when debugging stops".
That's what I have always used but cin.get() looks easier as one would normally include anyway. NB. It's not needed in Qt as the system keeps the console open until you press a key (Windows, Linux or Mac).
This is a simple function I came up with on a program assignment a few years ago. That way the program will only end if 'N' is entered telling the program to not continue, and to exit with return 0. char ContinueChoice() { char Continue; cout > Continue; Continue = toupper(Continue); while (Continue != 'Y' && Continue != 'N') { system("CLS"); cout
I should have waited a little longer for the answer that you give. However, in my defense. Yesterday I looked for this "start without debugging and did not see it. That my excuse and I'm sticking to it! So thank you for answering my previous question.
@@CodeBeauty actually I wanted to thank you for uploading c++ course. I am looking for job and needed c++ very badly. I watched your video and learned c++ in just 4 days. I can attend interview and hope get the job.
You have no idea how useful (and educational!) this video turned out to be for a current project of mine. Thank you so much for sharing your knowledge!! Greetings from Argentina :)
Wow it's something new for me with "pause>0" and that's it works only in PC. Thanks! Also, it's will be good to make a tutorial for STL some containers (methods) and lib algorithm, boost, how to add libs, api and sdk in the c++ project it's very interesting. Thanks again for the lessons!
Breakpoints aren't viable when there are multiple returns in main, or exit() is being called from multiple places elsewhere in the code. Though conceivably you could put a breakpoint on exit(). A portable method I like to use is to have a user-defined function that pauses before the function exits, and register that function with atexit() at the start of main(). This guarantees the pause will still execute regardless of where the program exits.
What a wonderful content and experience in c++ you share with us for free. I glad to you that there is people like you ☺️☺️. I hope you continue in c++ with data structure and algorithms, finally GUI with c++.
yo guys, what about "return 0"? I used to use it on linux, dunno its function :/ Amazing work btw, love ur vidz, i'm currently re-learning my whole c++ course in your 10+ hrs vid. Didn't had the chance before to get it that well but, now i'm so ready to master c++!
If your compiler wants int main(){} then you need to return an int as it reaches the end. Convention says return 0 means mo errors or completed successfully.
Another simple solution is also an empty while loop set to 1. Just add while(1){} just before the end of main function. Program will pause and show output with nothing more than a while loop.
After messing around with the code. I am able to run system(pause>0") and also null...only unless I have #include code along with iostream I should probably start making code, programming videos 📹
😊 🙏 😊 thanks for sharing this video. i am sure it's well intended but... you are showing solutions to something that is not really problem. it works but these were not intended for pausing execution. the main issue is simply that you are building a console app. run it in the new terminal.exe or cmd.exe and all we be good. (or tell visual studio to stop closing the window after execution).
nice video and please if you have the time make a video how to make dynamic array of templete objects please i tried a lot and did not find good video on that topic and keep that work rate up
I have a suggestion for an interesting advanced topic for a new video. There is a 128-bit decimal in C# and the .NET Framework. What is the best way to create a 128-bit double or float or decimal in C++? I did read about quad precision doubles and floats. I potentially found several projects on GitHub but I haven't looked into it beyond that. There is apparently a 80-bit long double but it's limited to non-microsoft compilers which limits its usefulness, especially if you're using Visual Studio.
GCC and Clang have __int128_t and __uint128_t as built-in integer types on 64-bit systems. "long double" is at least 80-bits on those same systems. It's just MSVC is the outlier. Conceivably you could create a DLL with MingW64 to do all your 128-bit / 80-bit calculations, then call the DLL from your MSVC program. But I suspect teaching how to do that is well outside the scope of this channel.
Indeed, it appears that creating a 128-bit decimal in C++ is so convoluted that I too suspect it wouldn't be a subject for this channel. It'd be nice if there was some standardize way to create a larger double or decimal in C++, maybe in C++ 23.
Et majke ti gledam devojku mesecima i nisam znao da je nasa Bosanka😊 svaka cast samo nastavi😁. Jesi li radila mozda neki framework npr. Qt ili SFML mislim to obicno traze za posao?.
Saldina, good work! Hei, I want to ask you something: why don't you continue your Web programming videos with Php, JS or so ? It would be very great, I think : D
conio.h originated with Microsoft C 2.0 from 1985. A few years later Borland copied how it worked for their Turbo C compiler. But getch() has never been standard C/C++, so you won't find it in Linux or MacOS. About the closest you'll get is getch() in the NCurses library, but it doesn't work quite the same way.
Welcome, sir I hope you are fine and healthy. I want to ask you a question regarding variable sizes. Is the integer variable equal in the console window to the size in the application window?
return(0); does not actually pause a C++ program. perhaps you have the box unchecked in visual studio next to: tools > options > debugging > general > automatically close the console when debugging stops
Can you please please make a video tutorial on win32 api and windows api ? This subject isn’t touched on that much thanks a lot and great video once again :)
I can't use VS on my Win7 32 bit so I have found code:block v17.12 works for me. But it was not running system ("pause") to clean the junk code, until I used system("pause>null"). I also was using #include along with iostream. Without the cstdlib it won't work.
All of my Perl scripts ended with system("pause") because it was the only way to keep the console window open. There's nothing worse than having a window close and I don't know if it fucked up or not.
Hi !! First of all thanks for videos. Very interesting for someone like me that started yesterday to learn C++ ^_^U. I have a question and it maybe stupid, but I dont understand it very well. Is there any difffence between " system ("pause>null") ", "system ("pause>0") and "return 0" ?? Which one is better/safer to use ?? Any big differences ?? Thanks in advance, Saldina and sorry if it is an stupid question. Cheers !!
Saldina, if you know the answer, why did Microsoft take away the simple run button out of Visual Studio? I don't see the benefit of that removal. I've had older versions of Visual Studio on another computer that's why I know that there was formerly a run button. On my machine that extra debugging makes my compile and run process very slow. Do you have a solution for this problem? I know that you are cutting and pasting so that it appears that the process is running almost instantaneously.
Quite the contrary it is good practice. Return 0 signalizes auccessful completion. You can also return a non-zero value to signal an error. This can be read e.g. by a shell script or batch file for example.
But it’s not standard practice. Can use void main (void). In functions a data type should return a data type value. It’s not about being smart, it’s all about teaching the proper methods and standards.
@@omarious I've read that using void main() is not standard C++ and that the standard has always been int main(). I'm not sure, but... I see the int function version everywhere, with the return 0.
I have a problem with path of my project exist in console app and code 0 I don't know what it is but I need your help for that because you are genies I know
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
Tools->Options->Debugging (General)->Automatically close the console when debugging stops (4th option from the bottom). VS 2019.
Thanks for sharing! 🤗
You don't need it if testing from the project folder...
i enrolled myself in an oop course at my school without knowing almost anything about programming and your videos have been helping me a lot, thank you so much.
That's brave! I wish you best of luck and I'm glad that my videos are helpful! 🤞🤗
Lady, you are doing a very great job. I am doing a home self study in C++ and web development, as I can't afford to go to college. I have almost every essential C++ and web development books. And I came to know about your videos just two weeks ago. You have really helped me a lot... Thanks a lot! Daniel from Zambia.
Welcome Daniel! What you are doing is very brave and smart, and I wish you the best of luck! You can do it without college! 🤞🤗
@@CodeBeauty Thanks a lot once more Saldina!
One thing you should have mentioned is that system("pause>0) creates a file on the default folder (debug by default in VS) without an extension. The file is simply called 0 because that is what you asked the system to do. you can use anything instead of 0. For example you can say: pause>test then it will create a file called test with the words "Press any key to continue . . . ".
The other command I sometimes use is system("cls"); this clears the screen before output so the statement is the first one in a program. Of course this is all good for console applications. For GUI it is never used.
Have you thought of doing videos for C#
Thanks and keep up with the good work. Where exactly are you teaching computing. Which country. you don't have to name your university if you don't want to.
Thanks for this useful comment!
I'm planing to do C# tutorials, and as soon as I free up some time, I'll start ☺️
Regarding the University, I have completed Bachelor Degree at Faculty of Information Technologies, University "Džemal Bijedić" in Mostar, with 9.2/10 grade 🎓😁
I used to work as a teacher, but I'm currently teaching only for fun on RUclips, and working 9-5 as a programmer in a company called EVONA 🤗🤗
@@CodeBeauty Thank you for responding to me. You are a really cleaver girl I can see and very dedicated in your work.
you can keep in touch with me. I live and work in London, UK and computing is just a hobby for me. My main job is Accounting and Tax. i did BSc in Mathematics, Computing and statistics at University of London so I know some C, C++, HTML/CSS/JavaScript and C#. Some Delphi as well.
Kind regards and I'll keep watching your videos regualrly.
I'm really becoming addicted by your lessons! :-)
Good 😁😁😛
Another way to prevent the window from closing in debug mode in the IDE is Debug > options > general tab (left side) > scroll down to and uncheck "Automatically close the console when debugging stops".
BEST option:
Sleep(seconds in milliseconds);
Remember to #include and #include to make it work!
It doesn't work for me
@@santiagotorres8907 oh sorry l forgot you also need to do this: #include
this is only for win.
there's a 4th option :
by going to Tools -> Options -> Debugging : and disable "Automatically close the console when debugging stops".
I guess that this is the from the best ways to do it,
and i almost forgot, big thanks and regards Nurak Saldina, for this video.
@CodeBeauty I've found another way to do it. It's a built-in option in VStudio 2019. Go to Tools > Options > Debugging > General.
Scroll down and uncheck the box saying, "Automatically close the console when debugging stops".
This is a great video.
There's also another way.
Header file *#include** *
Then *_getch();* at the end of the code or above return 0; if included.
That's what I have always used but cin.get() looks easier as one would normally include anyway.
NB. It's not needed in Qt as the system keeps the console open until you press a key (Windows, Linux or Mac).
conio is not portable
@@inotopia ^this
Finally a detailed video for my Doubt I'm so happy
🤞🤗🤗
I am a professional noob of programming lol
But your videos make me understand each and everything clearly...Good job ma'am 👍
This is a simple function I came up with on a program assignment a few years ago. That way the program will only end if 'N' is entered telling the program to not continue, and to exit with return 0.
char ContinueChoice()
{
char Continue;
cout > Continue;
Continue = toupper(Continue);
while (Continue != 'Y' && Continue != 'N')
{
system("CLS");
cout
Ma'am please make videos on Data Structures & Algorithms in C++. Love your way of teaching ma'am.
Excellent series of videos; I always pick up something useful.
I should have waited a little longer for the answer that you give. However, in my defense. Yesterday I looked for this "start without debugging and did not see it. That my excuse and I'm sticking to it! So thank you for answering my previous question.
Good work, very useful video. Keep it up
I will! Thanks! 🤞🤗🤗
@@CodeBeauty actually I wanted to thank you for uploading c++ course. I am looking for job and needed c++ very badly. I watched your video and learned c++ in just 4 days.
I can attend interview and hope get the job.
You have no idea how useful (and educational!) this video turned out to be for a current project of mine. Thank you so much for sharing your knowledge!! Greetings from Argentina :)
Wow it's something new for me with "pause>0" and that's it works only in PC. Thanks!
Also, it's will be good to make a tutorial for STL some containers (methods) and lib algorithm, boost, how to add libs, api and sdk in the c++ project it's very interesting. Thanks again for the lessons!
Thank you, I appreciate the way you teach.
🥰🤗🤗
Right on schedule. Thanks Saldina!
You're so welcome! 🤗
Breakpoints aren't viable when there are multiple returns in main, or exit() is being called from multiple places elsewhere in the code. Though conceivably you could put a breakpoint on exit().
A portable method I like to use is to have a user-defined function that pauses before the function exits, and register that function with atexit() at the start of main(). This guarantees the pause will still execute regardless of where the program exits.
Under the Linker item in Visual Studio you can set this to Console and the system will automatically pause even in debug mode.
Thanks for sharing! 🤞🧡
Yes. Please. Thanks for this. C++ is getting clearer now.
What a wonderful content and experience in c++ you share with us for free. I glad to you that there is people like you ☺️☺️. I hope you continue in c++ with data structure and algorithms, finally GUI with c++.
You can also use getchar() function.
Yep, that would work as well. Thanks for sharing! 🤗
The MS CRT also has the _getch() function (from conio.h).
yo guys, what about "return 0"? I used to use it on linux, dunno its function :/
Amazing work btw, love ur vidz, i'm currently re-learning my whole c++ course in your 10+ hrs vid. Didn't had the chance before to get it that well but, now i'm so ready to master c++!
If your compiler wants int main(){} then you need to return an int as it reaches the end. Convention says return 0 means mo errors or completed successfully.
you can also use getch(); to pause the program. :) i use it alot in my program
Yep, it's similar to cin.get
Thanks for sharing 🤗🧡
getch is in conio.h, it's usually not a good idea to use conio.h as it's not portable and not standard
u can also us getchar()
@@aaditshreyas889 I would recommend using std::cin.get() to pause the program
Nice video sis, you are doing an excellent job
Thank you!! 🔥🧡
Kaportaya geldim, yazılım programlama ogrendim.
Thank you so much!
Hey your explanation is amazing. Can you make that cin.get() video please? 🥺
very informative. Can you make a video on return 0; please.
That is a great suggestion and I'll definitely do a video about it soon! 🤗🤗
thank you very much for your very informative videos !, you answer the exact questions i try to understand.!
Your videos are so much helpful
I am your big fan 😁😁
Your coding skil are osm 😍
Now i am trust myself to undastand coding befor see your video 😼😼
Another simple solution is also an empty while loop set to 1. Just add while(1){} just before the end of main function. Program will pause and show output with nothing more than a while loop.
But then how do you (elegantly) stop the program?
Thank you so much! Was wondering why my codes didnt work in linux
thanks for the lesson i really appreciate you
Wow, I really enjoy these videos, the way you can explain these concepts are great!
You can use return 0; as well
Perfect.
Thank you.
☺️☺️
After messing around with the code. I am able to run system(pause>0") and also null...only unless I have #include code along with iostream
I should probably start making code, programming videos 📹
Thanks Saldina
😊 🙏 😊
thanks for sharing this video. i am sure it's well intended but...
you are showing solutions to something that is not really problem.
it works but these were not intended for pausing execution.
the main issue is simply that you are building a console app.
run it in the new terminal.exe or cmd.exe and all we be good.
(or tell visual studio to stop closing the window after execution).
You gained a subscriber for yourself.
Amazing content. Keep going 👍💪
Awesome, Thank you for video
If possible, mam please make video on C++ STL library
Thank you very HELPFUL!!!
🤞🤗
love this series
Thank you. What about the "return 0" function?
Thank you for the knowledge! I did not know that.
I generally use return 0 ; is it a good practice??
It is a good practice. 🤗🤗
Thank you
Very helpful, thanks again! :)
nice video
and please if you have the time make a video
how to make dynamic array of templete objects please i tried a lot and did not find good video on that topic
and keep that work rate up
I have a suggestion for an interesting advanced topic for a new video. There is a 128-bit decimal in C# and the .NET Framework. What is the best way to create a 128-bit double or float or decimal in C++? I did read about quad precision doubles and floats. I potentially found several projects on GitHub but I haven't looked into it beyond that. There is apparently a 80-bit long double but it's limited to non-microsoft compilers which limits its usefulness, especially if you're using Visual Studio.
GCC and Clang have __int128_t and __uint128_t as built-in integer types on 64-bit systems. "long double" is at least 80-bits on those same systems. It's just MSVC is the outlier.
Conceivably you could create a DLL with MingW64 to do all your 128-bit / 80-bit calculations, then call the DLL from your MSVC program. But I suspect teaching how to do that is well outside the scope of this channel.
Indeed, it appears that creating a 128-bit decimal in C++ is so convoluted that I too suspect it wouldn't be a subject for this channel. It'd be nice if there was some standardize way to create a larger double or decimal in C++, maybe in C++ 23.
Et majke ti gledam devojku mesecima i nisam znao da je nasa Bosanka😊 svaka cast samo nastavi😁.
Jesi li radila mozda neki framework npr. Qt ili SFML mislim to obicno traze za posao?.
Saldina, good work! Hei, I want to ask you something: why don't you continue your Web programming videos with Php, JS or so ? It would be very great, I think : D
C++ videos are getting more views at the moment, but I will continue the web dev series in the future 🤗🤗
we used to use getch() function from header, not sure if it works anymore
conio.h originated with Microsoft C 2.0 from 1985. A few years later Borland copied how it worked for their Turbo C compiler. But getch() has never been standard C/C++, so you won't find it in Linux or MacOS. About the closest you'll get is getch() in the NCurses library, but it doesn't work quite the same way.
What about using “ return 0; “ before the end of the program?
Thank you very much for what are you doing ❤️
Any time! 🧡
Welcome, sir
I hope you are fine and healthy.
I want to ask you a question regarding variable sizes.
Is the integer variable equal in the console window to the size in the application window?
guys, so why dont we use return instead? I'm new to C++ so this is not a joke question. Thanks!
Good job, from Brasil!
My question is why not just use return 0;; I'm new to the channel so if you explained that already but I'm curious. Thanks, from Temecula CA
return(0); does not actually pause a C++ program. perhaps you have the box unchecked in visual studio next to: tools > options > debugging > general > automatically close the console when debugging stops
mam when will u post sorting videos bubble sort etc.
Thank you so much!!!
You're welcome! 🧡
Is making functions which already exist (like the cout
Can you please please make a video tutorial on win32 api and windows api ? This subject isn’t touched on that much thanks a lot and great video once again :)
Thank you so much!
Thank you 🙏
Crystal clear
would you be doing live in near future?
or have any plan like that?
Hello Can you make video of how to make an onscreen functional keyboard or keypad, Thank you
احسنتي ..شرح جميل استمري ❤️
I can't use VS on my Win7 32 bit so I have found code:block v17.12 works for me. But it was not running system ("pause") to clean the junk code, until I used system("pause>null").
I also was using #include along with iostream. Without the cstdlib it won't work.
@CodeBeauty : Another very useful video Saldina :-) Thank you so much :-)
Is there a series on multithreading?
Code beauty, Voice beauty and your beauty, it's make it perfect, keep it up😊
Thank you, I will! 🤗
I use 'return 0' it is used in c to stop executio;
All of my Perl scripts ended with system("pause") because it was the only way to keep the console window open. There's nothing worse than having a window close and I don't know if it fucked up or not.
can i do something similar in visual studio code? do i need to download this IDE, what underlying library is it using?
You look better without glasses love😍
Hi !!
First of all thanks for videos. Very interesting for someone like me that started yesterday to learn C++ ^_^U.
I have a question and it maybe stupid, but I dont understand it very well.
Is there any difffence between " system ("pause>null") ", "system ("pause>0") and "return 0" ?? Which one is better/safer to use ?? Any big differences ??
Thanks in advance, Saldina and sorry if it is an stupid question.
Cheers !!
getch() can be used to hold the console which is defined in stdio.h header file
Can "return 0;" be used instead.
Another tutorial request: union type
I completely enjoyed the video, thanks Saldina, however you never said why it is considered a bad practice
Yes she did. The problem is that it only works for Windows. The program wouldn't run correctly on Mac or Linux.
She was clear ,
It is not cross-platform
Good point Kuken Balle and Pac Tube! Thanks! 🤗🤗
Thanku 😃
You're welcome! 😊🤗
Saldina, if you know the answer, why did Microsoft take away the simple run button out of Visual Studio? I don't see the benefit of that removal. I've had older versions of Visual Studio on another computer that's why I know that there was formerly a run button. On my machine that extra debugging makes my compile and run process very slow. Do you have a solution for this problem? I know that you are cutting and pasting so that it appears that the process is running almost instantaneously.
My question is If I write return 0; on the end of int main(), is it also bad practice like system("pause") ?
Quite the contrary it is good practice. Return 0 signalizes auccessful completion. You can also return a non-zero value to signal an error. This can be read e.g. by a shell script or batch file for example.
Wouldn't it be better to use "Pause>nul" to not create a file named "0" with "Press any key" inside it? :-P
You're right. If you use nul, it will redirect the output to file which is automatically discarded. This is a good point! Thanks for sharing! 🤗🧡
Does the regular "pause" create any files?
@@anonymoususer7663 just pause doesn't create a file.
No return 0; after int main()
It's optional.
return 0; is optional in C++, it is mandatory in C.
But it’s not standard practice. Can use void main (void). In functions a data type should return a data type value. It’s not about being smart, it’s all about teaching the proper methods and standards.
@@omarious I've read that using void main() is not standard C++ and that the standard has always been int main(). I'm not sure, but... I see the int function version everywhere, with the return 0.
This is a very good idea for some future video 🤔😊🤗
Getch() or return?
Can we user this System("pause") in other IDE also like in Turbo or Codeblock
yes. it works in codeblocks
I understand your logic behind this but it doesn't close the output window when I use Microsoft visual studio debug console .why?
Then what is use of return 0 ... Please tell me
I have a problem with path of my project exist in console app and code 0 I don't know what it is
but I need your help for that because you are genies I know
is return 0; and system("pause"); same?
what about return 0 ?? i think i see you are the first one who use system pause >0 in youtube