📚 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.
#include using std::cout; using std::cin; using std::string; using std::endl; struct Question{ // ** Struct with question + 3 answer and a int for the correct choice ** string questionText; string answer[3]; int correctAnswer= NULL; }; bool correctAnswer(int correct) { // ** ask and check if the answer is correct or not with a bool ** int answer; cout > answer; while (answer > 3 || answer < 1) { // Check if the user enter a not valid number cout > answer; } if (answer == correct) { // check if the answer is correct cout
Nice. But structure array will reduce the redundant lines of your code. Try using that. Here is my code for reference. #include using namespace std; int score; struct Quiz{ string question; int answer; }; struct Options{ string option1; string option2; string option3; }; void results(Quiz *questions,Options *options){ for(unsigned int i=0;i
If I were you, instead of writing (or coding) "question1", ..., "question5", I would have code an array of questions for 5 elements, and thus your code could be more compact.
@@simaobonvalot9141 it depends what you need. K.Sayood Data Compression, Adam Drozdek Data structures and algorithms I have this one in Polish and his book also on data compression. Any book by Robert Sedgewick with C or C++ on algorithms is also very good. Cheers.
For last 5 day I am just searching out your channel and you even write a comment to me this morning. It is finally feeling me like "I CAN UNDERSTAND!" thanks for everything, you are the best teacher ever!
I am actually writing an ORM to abstract my SQL statements. One of the thing I did was create a way to map my C structures into the ORM like a virtual structure. Heavy use of pointers to the structure elements was used and became very helpful in the abstraction.
You are amazing, but you forgot to answer the most important question of all - what is the difference between a struct and a class... the answer is: The only difference between a struct and class in C++ is the default accessibility of member variables and methods. In a struct they are public; in a class they are private (at least per my understanding).
Most programming classes or structured college courses teach to always specify access modifiers explicitly in your code anyways, which somewhat makes the point moot to people with formal classes. But for beginners who do not take formal classes, you do have a point.
1) Well you can not have methods/functions inside a structure. 2) Structur is used for small stuff and class is used for big stuff 3) In struct members are public by default whereas in class they are private by default.
@@yashsonawane905 Structs can be large and complex. Remember, they existed before the concept of classes came to be. Which is why you rarely pass a large struct to a function by value, but rather a pointer to the struct.
Structures are stored in stack memory while classes use heap memory. A major difference which tells us about the time complexity and memory complexity.
I did the quiztest project and it was beautiful, I applied what you suggested with structures and nesting with "for", it took me 3 weeks to do it and I used the knowledge I acquired from you in the 10 hour course, Thank you very much! ❤️🤗
I was wondering when to use a struct and when to use classes + objects. 2) I think it is always good to show the teacher's solution so we can compare it with ours! Thx for nice tutorials..
I didn't understand that part where you said create a structure for answers as well but this is how I did it. I hope it's fine this way as well. It's working completely fine. Please check it out. #include #include struct Question { std::string Questiontext; std::string options[3]; int Correctanswer; }; int main() { Question question[3]; question[0] = { "What's your favorite animal?", {"Dog", "Cat", "Rabbit"}, 2}; question[1] = { "What is your favorite show?", {"Drake & Josh", "BTR", "iCarly"}, 1}; question[2] = { "What is your favorite color?", {"blue", "green", "red"}, 1}; for (int i = 0; i
#include using namespace std; int main() { const int ANSWER_COL = 4; const int ARRAY_ROW_SIZE = 5; const int ARRAY_COL_SIZE = 5; const int BASE_INDEX = 0; short int iCorrectCount = 0; string strAnswer = ""; printf(" Choose the correct answer from the given options. "); printf(" There are five questions to answer and for each question, you must choose "); printf(" from the three options provided, which is the correct answer...
"); printf(" ... Good Luck!/Bahati njema! "); string queArray[ARRAY_ROW_SIZE][ARRAY_COL_SIZE] = { {"a) Who was SA's first democratic president?", "1. T.M. Mbeki", "2. H.W. de Klerk", "3. N. Mandela", "3"}, {"b) Which is the biggest soccer team in South Africa?", "1. Kaizer Chiefs", "2. Orlando Pirates", "3. Mamelodi Sundowns", "1"}, {"c) Which of these planet is the closest to the Sun?", "1. Mars", "2. Jupiter", "3. Mercury", "3"}, {"d) Which mammal has 98% of genealogy similar to homo sapiens'?","1. Monkey", "2. Chimpanzee", "3. Orangutan", "2"}, {"e) Which member of the pop group New Edition was ejected from the group?", "1. M. Bivin", "2. B. Brown", "3. R. Bell", "2"} }; for (int i=0;i
Hello Saldina, I am learning to code in order to create a trading robot in Metatrader 5. I find your teaching moves along nicely. Thank you for doing these C++ lessons.
One thing i have learned is not to use single letter variables. The reason is that it is sooo tedious to search for a single-letter variable in a larger program. Just using 'ps' as 'person' instead of 'p' can save you from a lot of grief. Loop-Iteration-vars like 'i' is an exception, from that recommendation.
thank you, if you are also interested in C#, check my Practical Programming Course at www.codebeautyacademy.com We are building real C# application and you will be learning alongside other students, with me as your personal tutor. With this you will also gain access to exclusive Discord community. I'll be happy to have you there. :)
thank you for your excellent videos you're a great teacher i'm learning computer engineering at the university but in your vedeos you explain these topics better than my proffs in the university they are easier to underestand thank you so much❤😍
The iPhone 12 starts at $799 + Storage capacity. Storage capacity options: 64 GB , 128 GB and 256 GB. The Samsung Galaxy S21 Ultra starts at $1.299 + Storage capacity. Storage capacity options: 128 GB , 256 GB and 512 GB. The more storage you want, the more it costs. Thank you very much for the videos that you upload. They really help me to switch from Java and C to C++.
its funny how my lectures completed C++ course in 2 years but I never came across Structures even today I don't know how to code a binary tree with Genuine Understanding I follow tutorials with Classes (OOP) Prior Knowledge...but I appreciate your content Miss/Mrs though I came late to the party am lucky that they don't have expiry date haa lol ❤️😜
Just came across this video....your explanation and demonstration is unique. this is the most easy to understand struct video i have ever come across . thanks so much for this video.
#include #include #include using namespace std; struct Option{ string text; }; struct Question { string text; Option options[3]; string correctAns; }; // Creating a function int answerCorrect( Question question,int numOfOptions){ // returns the correct answer in terms of number, making a match between the correct answer and one of the options provided int correct; for (int j = 0 ; j < numOfOptions ; j ++){ if ( question.options[j].text == question.correctAns) { correct = j +1; break; }else{ correct = -1 ; } } return correct ;// can return 1,2,3 or -1 } int main() { Question questions[100]; // supposed that the Trivia can have at most 100 questions string question; string option; string correctAns; int numOfOptions; int numberOfQuestions; cout numOfOptions; for (int i =0 ; i < numberOfQuestions ; i ++ ){ cout
Hi Saldina. You ask us to print our code so I will. I added a couple of touches. Hope you don`t mind, teacher...lol. struct Test{ string question[2]; string choices[2]; }; void Menu(Test test1){ cout
In llne 50 at 26:58, where we have p.smartphone, is the "smartphone" the object we created earlier or the struct? Coz I am so confused when we did the assignment of it.
My answer to that question is there's no way I'm paying anything close to those prices for a phone, and I still wouldn't if I was a millionaire. Another great tutorial, as usual. Thank you.
Make structure contain:(string question and array of choise build by for loop) for each question and make comon answer array 0,1 take the cin of user then make answer array forloop increment value for correct ans
Officially subscribed. I'm currently learning C++ and your videos, alongside all my C++ books and Udemy course is helping me a lot. Thank you for your quality content. Also, you're gorgeous!
Haven't touched C/C++ in a while, but off the top of my mind, without compilation, from an unsaved Notepad: struct quizzQuestion { string question; string answerA; string answerB; string answerC; char correctAnswer; // 'a' or 'b' or 'c' }; int QuizzThemOnThis (quizzQuestion q) { cout
Hello saldina, Your videos are so helpful for us. I stop watching other videos on c++, your videos are more than enough for me. Also sharing your videos with my friends to help reach 1M subscriber soon.😊😊
Hi Saldina. I did it with structures and I used a do while loop instead of nesting. It works fine. You are a great teacher. I had trouble passing the array references into the structure so I had to set the arrays manually. Did you use pointers in yours.?
Nice presentation! One thing I would ad is the use of arrays of structures so the same structure can be used repeatedly to store different values of the same type.
Excellent video. The output (cout) examples tied everything together; clean, succinct and paced very well with focused instruction and description (treatment).
Hi ! Saldina . i hope you are doing fine ? i watchcd this tutorial yeasterday 29/august/2023 and i understood what is structure and how they work. thank you about that . the quiz of last part of lesson i was did, but i don't use loops b/c .l don't know how to use loops in that more and different questions. i only use array, structure, and cout, cin .
You should do a video with a counter to see how many requests for comments are possible in one lesson... (I was resisting commenting as hard as I could too! Well earned.)
I am new to programming dont whether this is the correct way to do this or not, but somehow this works #include #include using namespace std; struct questionOptions { string OptionA{}; string OptionB{}; string OptionC{}; int correctAnswer{}; }; questionOptions que; void assignAns(string opt1, string opt2, string opt3, int CorrectAnswer) { que.OptionA = opt1; que.OptionB = opt2; que.OptionC = opt3; que.correctAnswer = CorrectAnswer; } int main(){
vector questions{ "Largest Country in the world?", "How many states are there in India?", "Biggest animal?", "Non Rectangular flag of the country", "Prime Minister of India" };
Hi Saldina, what are the main advantages to learn C++ that cannot be done or achieved with or via python. In other words, what are the main motive for a python expert to seriously dedicate time to master C++. And I wonder if there is extra specific advantages to master C++ as the only language for someone with a computational neuroscience background. Will be grateful for your reply. Thanks
C++ is faster, python is slower and Python is mostly used for data science and numbers calculations while C++ is used for application development more than data manipulation.
wow !!! thanks for the exercise, it wasn't easy for me but I did it :) at least it works, I don't know if the path taken is the right one but it's already a satisfaction tanks again.
structs are usually used as data containers, that is, without methods, and classes where you need to attach behaviour to your type altho you can make attributes private/public and have methods so it all depends on the style; usually that's the case
Generally spoken, both are they same. The difference is that with "struct" all members of a struct are public by default, whereas with "class" all members of a class are private by default.
I found myself wondering what the differences were between struct vs using class, meaning when it is important to use one vs the other. I went searching on youtube on the question, and the only pragmatic use difference I could find out is that struct is public by default, while class is private by default, otherwise don't they pretty much do the same things as each other? Sorry for asking what is probably a dumb question.
Perfect tutorials, good day everyone I'm struggling to create n make a delete function for an employment management system ..if there is any help I could upload it here if yall don't mind
Samsung used to be better both at performance and price but since last 3-4 years they raised their prices to match these of apple , which is crazy overpriced. Great lessons 👍 keep going
I have seen a few of your TH-cam videos on C++ and found them very well presented, easy to follow and informative in detail. However, on this occasion I found this to be a bit difficult to follow; seemingly a ramble through the process, lacking in explanatory detail. But, in the end, I had learned little. Nevertheless thanks for the stunning effort. Thanks.
Although at the first sight they appear almost the same they function differently At the base struct is a data type. Think of it as a special array with key value pair . Note that in C++ you can have methods in a struct. Class is not a data type. The first difference you will see is in a struct the data are by default public but data of a class are private. There are some differences in memory allocation. Use struct when you have a bunch of data that act like they stick together. As an example. Student as a struct. (Name grade major) Use a class when you have to do something more. Some computation or you need encapsulation of the data. Struct in C++ are kept to be backward compatible with C. ( that's just my opinion. You can write C style in C++ but that defeats the purpose of writing C++ code) But you can find use for them even if you write OOP like code.
ma'am please make videos on Data Structures & solution of this quiz problem. Ma'am really love your way of teaching. Just keep going.❤ You are the only one who focus more on foundation. Thank you ma'am.
I am watching the tutorial in june 2022 and the i phone cost is $699 right now. Greetings CodeBeauty. Thanks for your videos they've helped me a lot. I wanna become a software engineer.
Yes!!!!!!!!!!!!!!!!!! Make a video we go through it and also add one more example in that video showing how we can store the structures in case we are making lets say a project on cars...whereby at the end we will need to output a kind of form for all cars. Thank Youuuuuu
📚 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.
Hi Saldina!
How do structures compare to classes?
definitely, you are a very good teacher.
#include
using std::cout;
using std::cin;
using std::string;
using std::endl;
struct Question{ // ** Struct with question + 3 answer and a int for the correct choice **
string questionText;
string answer[3];
int correctAnswer= NULL;
};
bool correctAnswer(int correct) { // ** ask and check if the answer is correct or not with a bool **
int answer;
cout > answer;
while (answer > 3 || answer < 1) { // Check if the user enter a not valid number
cout > answer;
}
if (answer == correct) { // check if the answer is correct
cout
thanks! I learned a lot about function-bool-struct features from this one.
Just use ''using namespace std;'' at this poiint lol
Good but you could have used structure array
Nice. But structure array will reduce the redundant lines of your code. Try using that. Here is my code for reference.
#include
using namespace std;
int score;
struct Quiz{
string question;
int answer;
};
struct Options{
string option1;
string option2;
string option3;
};
void results(Quiz *questions,Options *options){
for(unsigned int i=0;i
If I were you, instead of writing (or coding) "question1", ..., "question5", I would have code an array of questions for 5 elements, and thus your code could be more compact.
please post c++ algorithms and data structures full course. thanks
There are books describing this subject. If you don't want to read books use those from the STL.
@@TheJaniczek what books do you recommend ?
@@simaobonvalot9141 it depends what you need. K.Sayood Data Compression, Adam Drozdek Data structures and algorithms I have this one in Polish and his book also on data compression. Any book by Robert Sedgewick with C or C++ on algorithms is also very good. Cheers.
@@TheJaniczek I was thinking about a book with solid foundations about C / C++ . In English or portuguese preferably..
For last 5 day I am just searching out your channel and you even write a comment to me this morning. It is finally feeling me like "I CAN UNDERSTAND!" thanks for everything, you are the best teacher ever!
I'm happy that you're here and learning 😊
This teacher really wants a lot of comments and likes and shares.
Lets give her it.
Thank you for the free tutorial.
I do, that way my tutorials will reach and teach more people 😁 thank you 🥰
So take my comment as well then.
I am actually writing an ORM to abstract my SQL statements. One of the thing I did was create a way to map my C structures into the ORM like a virtual structure. Heavy use of pointers to the structure elements was used and became very helpful in the abstraction.
You are amazing, but you forgot to answer the most important question of all - what is the difference between a struct and a class... the answer is:
The only difference between a struct and class in C++ is the default accessibility of member variables and methods. In a struct they are public; in a class they are private (at least per my understanding).
Most programming classes or structured college courses teach to always specify access modifiers explicitly in your code anyways, which somewhat makes the point moot to people with formal classes. But for beginners who do not take formal classes, you do have a point.
thanks. i was surely wondering
1) Well you can not have methods/functions inside a structure.
2) Structur is used for small stuff and class is used for big stuff
3) In struct members are public by default whereas in class they are private by default.
@@yashsonawane905 Structs can be large and complex. Remember, they existed before the concept of classes came to be. Which is why you rarely pass a large struct to a function by value, but rather a pointer to the struct.
Structures are stored in stack memory while classes use heap memory. A major difference which tells us about the time complexity and memory complexity.
这是我在最近一个周以来,看您的第21个视频了;我从未见过如此优秀低调的老师!谢谢您!
I did the quiztest project and it was beautiful, I applied what you suggested with structures and nesting with "for", it took me 3 weeks to do it and I used the knowledge I acquired from you in the 10 hour course, Thank you very much! ❤️🤗
My God, you´re like an angel that came to teach us C++! Thank you so much!
I was wondering when to use a struct and when to use classes + objects. 2) I think it is always good to show the teacher's solution so we can compare it with ours! Thx for nice tutorials..
I am working on my MSCS and your videos greatly help me
I didn't understand that part where you said create a structure for answers as well but this is how I did it. I hope it's fine this way as well. It's working completely fine. Please check it out. #include
#include
struct Question
{
std::string Questiontext;
std::string options[3];
int Correctanswer;
};
int main()
{
Question question[3];
question[0] = {
"What's your favorite animal?",
{"Dog", "Cat", "Rabbit"},
2};
question[1] = {
"What is your favorite show?",
{"Drake & Josh", "BTR", "iCarly"},
1};
question[2] = {
"What is your favorite color?",
{"blue", "green", "red"},
1};
for (int i = 0; i
thanks
oh wow that was exactly what i was searching for! Your code is short and sweet! Questions are rather funny lol.
@@andewprod haha thanks! I'm glad it helped.
Programming is fascinating it can make our life more easier I'm lazy and hate doing things on repeat
Mam I have a request .Can You Please make a tutorial on "File and Exception handling " in c++
#include
using namespace std;
int main()
{
const int ANSWER_COL = 4;
const int ARRAY_ROW_SIZE = 5;
const int ARRAY_COL_SIZE = 5;
const int BASE_INDEX = 0;
short int iCorrectCount = 0;
string strAnswer = "";
printf("
Choose the correct answer from the given options.
");
printf(" There are five questions to answer and for each question, you must choose
");
printf(" from the three options provided, which is the correct answer...
");
printf(" ... Good Luck!/Bahati njema!
");
string queArray[ARRAY_ROW_SIZE][ARRAY_COL_SIZE] = {
{"a) Who was SA's first democratic president?", "1. T.M. Mbeki", "2. H.W. de Klerk", "3. N. Mandela", "3"},
{"b) Which is the biggest soccer team in South Africa?", "1. Kaizer Chiefs", "2. Orlando Pirates", "3. Mamelodi Sundowns", "1"},
{"c) Which of these planet is the closest to the Sun?", "1. Mars", "2. Jupiter", "3. Mercury", "3"},
{"d) Which mammal has 98% of genealogy similar to homo sapiens'?","1. Monkey", "2. Chimpanzee", "3. Orangutan", "2"},
{"e) Which member of the pop group New Edition was ejected from the group?", "1. M. Bivin", "2. B. Brown", "3. R. Bell", "2"} };
for (int i=0;i
Hello Saldina, I am learning to code in order to create a trading robot in Metatrader 5. I find your teaching moves along nicely. Thank you for doing these C++ lessons.
Slowly gaining momentum in c++ with you only.. A big biggggg thanx.. As i am getting into embedded tech, ur c++ giving me boost.
@sekharathome Can you guide me on how to get started with embedded tech? I am an ECE student.
¡Gracias!
One thing i have learned is not to use single letter variables. The reason is that it is sooo tedious to search for a single-letter variable in a larger program.
Just using 'ps' as 'person' instead of 'p' can save you from a lot of grief.
Loop-Iteration-vars like 'i' is an exception, from that recommendation.
I guess this depends on the fact if its a local variable or a global variable
Your videos are so neat and clean. No extra words. I learned a lot and apply them in my research. Thanks for all the hardwork!
thank you, if you are also interested in C#, check my Practical Programming Course at www.codebeautyacademy.com
We are building real C# application and you will be learning alongside other students, with me as your personal tutor. With this you will also gain access to exclusive Discord community.
I'll be happy to have you there. :)
This must be the best channel for C++
Great explanation! My interest in coding is being developed by watching your videos and by practicing them. Thanks a lot
Hi
I love C++! I'll give it a try to the quiz app this weekend on my free time. Thanks Saldina, you have helped me a lot!
thank you for your excellent videos you're a great teacher i'm learning computer engineering at the university but in your vedeos you explain these topics better than my proffs in the university they are easier to underestand thank you so much❤😍
The iPhone 12 starts at $799 + Storage capacity.
Storage capacity options: 64 GB , 128 GB and 256 GB.
The Samsung Galaxy S21 Ultra starts at $1.299 + Storage capacity.
Storage capacity options: 128 GB , 256 GB and 512 GB.
The more storage you want, the more it costs.
Thank you very much for the videos that you upload. They really help me to switch from Java and C to C++.
You're the best modern c++ teacher in TH-cam University
Saldina, I enjoy studying C/Cpp and I absolutely appreciate you videos!
Thank you, I think nobody explains anything better than you do. You are great!!!
Why would someone use a structure instead of a class and vice versa? They seem to have the same syntax.
its funny how my lectures completed C++ course in 2 years but I never came across Structures even today I don't know how to code a binary tree with Genuine Understanding I follow tutorials with Classes (OOP) Prior Knowledge...but I appreciate your content Miss/Mrs though I came late to the party am lucky that they don't have expiry date haa lol ❤️😜
Youre teaching method is excellent, you deserve wayyyyy more views. Dont stop, youll go wayy big some day!
🙏💙
I love the way you said "Like this" at the end. Learning a lot ma'am 🤘🤘
🥰
You make learning C++ easy for me thank you
Just came across this video....your explanation and demonstration is unique. this is the most easy to understand struct video i have ever come across . thanks so much for this video.
In 2024 the iPhone 12 costs about $800
definitely, you are a very good teacher.
#include
#include
#include
using namespace std;
struct Option{
string text;
};
struct Question {
string text;
Option options[3];
string correctAns;
};
// Creating a function
int answerCorrect( Question question,int numOfOptions){ // returns the correct answer in terms of number, making a match between the correct answer and one of the options provided
int correct;
for (int j = 0 ; j < numOfOptions ; j ++){
if ( question.options[j].text == question.correctAns) {
correct = j +1;
break;
}else{
correct = -1 ;
}
}
return correct ;// can return 1,2,3 or -1
}
int main()
{ Question questions[100]; // supposed that the Trivia can have at most 100 questions
string question;
string option;
string correctAns;
int numOfOptions;
int numberOfQuestions;
cout numOfOptions;
for (int i =0 ; i < numberOfQuestions ; i ++ ){
cout
i need this its not working please help
Hi Saldina. You ask us to print our code so I will. I added a couple of touches. Hope you don`t mind, teacher...lol.
struct Test{
string question[2];
string choices[2];
};
void Menu(Test test1){
cout
Your explanation is very wonderful, I loved it and benefited a lot from it
But i have question ,
What's different between structure and Class
Thanks! Structure members are public by default, and class members are private 🤗🤗
Namaste Saldina! Your teaching approach is so cool.
Gotta tell you, this is the best c++ channel.
keep up the good work.
amazing presentation. You just make coding easy and fun!
These are excellent courses that I am using as a refresher as I mostly use C for embedded code but love C++.
The best explanation ever!!!!! Thank you .
I first like before listening to the course. Thank you!!!
U are the best techer ever God bless u will go far in life 🙏🙏🤜🤜🤜🤜
Thank you 🥰🥰
you are the best programmer
you can be even better, i can help you :)
@@CodeBeauty thank a lot 😊 I am new subscriber
Easy to understand explanation of structures. Thanks CodeBeauty.
In llne 50 at 26:58, where we have p.smartphone, is the "smartphone" the object we created earlier or the struct? Coz I am so confused when we did the assignment of it.
What a good explanation.
My answer to that question is there's no way I'm paying anything close to those prices for a phone, and I still wouldn't if I was a millionaire. Another great tutorial, as usual. Thank you.
Here 😁 youre the best in our school youre helpful
🥰🥰
Plz share the solution and upload videos twice a week plz.... They helped us a lot
Make structure contain:(string question and array of choise build by for loop) for each question and make comon answer array 0,1 take the cin of user then make answer array forloop increment value for correct ans
Officially subscribed. I'm currently learning C++ and your videos, alongside all my C++ books and Udemy course is helping me a lot. Thank you for your quality content. Also, you're gorgeous!
Haven't touched C/C++ in a while, but off the top of my mind, without compilation, from an unsaved Notepad:
struct quizzQuestion {
string question;
string answerA;
string answerB;
string answerC;
char correctAnswer; // 'a' or 'b' or 'c'
};
int QuizzThemOnThis (quizzQuestion q) {
cout
Didn't listen to her past 30:20
Hello saldina,
Your videos are so helpful for us. I stop watching other videos on c++, your videos are more than enough for me.
Also sharing your videos with my friends to help reach 1M subscriber soon.😊😊
Thank you so much! You are helping to teach other people by sharing! That is so generous and nice of you!🙏💙
Can we use constructor in structure like class
Hi Saldina. I did it with structures and I used a do while loop instead of nesting. It works fine. You are a great teacher. I had trouble passing the array references into the structure so I had to set the arrays manually. Did you use pointers in yours.?
//Task Completed👍
#include
using namespace std;
struct quiz{
string question;
string option1;
string option2;
string option3;
int answer;
};
void display(quiz q){
cout
Amazing😍😍...But i recognize few flaw on the 2 last questions of the Quiz.
its correct but you had to used arrays instead of writing question 1 by 1.
amazing >
QuizApplication is done, Form Bangladesh. I follow your C++ videos. Thanks
Nice presentation! One thing I would ad is the use of arrays of structures so the same structure can be used repeatedly to store different values of the same type.
#include
#include
using namespace std ;
struct Quiz
{
string Question;
string Answer[3];
};
void Info(Quiz q)
{
cout
Wow i like this answer. Very direct and simple to understand. Thanks.
@@nebertngari6627 you're welcome
@@mutawakkilsanusibabasidi3859 I have tried running this code but it ain't working.
On which IDE??
@@mutawakkilsanusibabasidi3859 Visual Studio code
12:00 ctlrl+shift+left || right = copy block of text at the left || right side of the cursor. ;)
P.S. +up||down, pgup||pgdown, home || end...
Excellent video.
The output (cout) examples tied everything together; clean, succinct and paced very well with focused instruction and description (treatment).
You should do a video about c++ applications in real world , it will be so interesting your perspective!
I can't believe that u r back 😊😊
Back to stay 🤗💗💗
Hi ! Saldina .
i hope you are doing fine ?
i watchcd this tutorial yeasterday 29/august/2023 and i understood what is structure
and how they work. thank you about that .
the quiz of last part of lesson i was did, but i don't use loops b/c .l don't know how to use loops
in that more and different questions.
i only use array, structure, and cout, cin .
So much better than my professor 🥰😍
You should do a video with a counter to see how many requests for comments are possible in one lesson... (I was resisting commenting as hard as I could too! Well earned.)
I am new to programming dont whether this is the correct way to do this or not, but somehow this works
#include
#include
using namespace std;
struct questionOptions
{
string OptionA{};
string OptionB{};
string OptionC{};
int correctAnswer{};
};
questionOptions que;
void assignAns(string opt1,
string opt2,
string opt3,
int CorrectAnswer)
{
que.OptionA = opt1;
que.OptionB = opt2;
que.OptionC = opt3;
que.correctAnswer = CorrectAnswer;
}
int main(){
vector questions{
"Largest Country in the world?",
"How many states are there in India?",
"Biggest animal?",
"Non Rectangular flag of the country",
"Prime Minister of India"
};
int queSize = questions.size() - 1;
for (int i = 0; i
Hi Saldina, what are the main advantages to learn C++ that cannot be done or achieved with or via python. In other words, what are the main motive for a python expert to seriously dedicate time to master C++. And I wonder if there is extra specific advantages to master C++ as the only language for someone with a computational neuroscience background. Will be grateful for your reply. Thanks
C++ is faster, python is slower and Python is mostly used for data science and numbers calculations while C++ is used for application development more than data manipulation.
C# is easier than C++
wow !!! thanks for the exercise, it wasn't easy for me but I did it :) at least it works,
I don't know if the path taken is the right one but it's already a satisfaction
tanks again.
In what scenario it is better to use Struct and better to use class(OOP) in C++?
structs are usually used as data containers, that is, without methods, and classes where you need to attach behaviour to your type altho you can make attributes private/public and have methods so it all depends on the style; usually that's the case
Generally spoken, both are they same. The difference is that with "struct" all members of a struct are public by default, whereas with "class" all members of a class are private by default.
Thank you so much..... Your content is really Fricking cool❗❗
Congratulations for the 30K subs, u surely deserve more....keep making 😊💯
Thank you so much! I'm very happy and grateful for every single person who watches and likes my videos! 🤗🧡🧡
I found myself wondering what the differences were between struct vs using class, meaning when it is important to use one vs the other. I went searching on youtube on the question, and the only pragmatic use difference I could find out is that struct is public by default, while class is private by default, otherwise don't they pretty much do the same things as each other? Sorry for asking what is probably a dumb question.
Perfect tutorials, good day everyone I'm struggling to create n make a delete function for an employment management system ..if there is any help I could upload it here if yall don't mind
Another very good tutorial! Thanks!
best video ever !!!!!!!!!!!!!1 rarely ppl do functions use them in the argument they just spoke of.
super stoked mql5 is based on c++ haha // CB you rock!
Salina please do vectors; and how they interact with objects and pointers.
Samsung used to be better both at performance and price but since last 3-4 years they raised their prices to match these of apple , which is crazy overpriced. Great lessons 👍 keep going
hey saldina, what a different of the struct and union and how and when we use both of them? please explain in another video.
Beautiful video. My question is, what coding do you teach in your paid course ma'am ?
how do you decide when you should use a struct and some functions or an object an methods?
Very good and useful video...Task to test our knowledge is the best portion here....it would be good if u can provide the test after each video....
Ma'am please make a series on DS & Algo :)
In progress... 🤞😊
you're strong 💪 thank you
You're brave! Thanks 😃🤗
Is there a difference between a class and a struct?
#include
using namespace std;
void answerChecker(int input, int i) {
int correctAnswers[] = {2, 3, 1, 2, 3};
if(input == correctAnswers[i]) {
cout
So basically Records in Delphi... but I think it's important to mention that these structures represent a *heterogeneous* set of elements
I have seen a few of your TH-cam videos on C++ and found them very well presented, easy to follow and informative in detail. However, on this occasion I found this to be a bit difficult to follow; seemingly a ramble through the process, lacking in explanatory detail. But, in the end, I had learned little. Nevertheless thanks for the stunning effort. Thanks.
You explain things in great detail which is appreciated. What determines if you should use a struct or a class?
Although at the first sight they appear almost the same they function differently
At the base struct is a data type. Think of it as a special array with key value pair . Note that in C++ you can have methods in a struct. Class is not a data type.
The first difference you will see is in a struct the data are by default public but data of a class are private. There are some differences in memory allocation.
Use struct when you have a bunch of data that act like they stick together. As an example. Student as a struct. (Name grade major)
Use a class when you have to do something more. Some computation or you need encapsulation of the data.
Struct in C++ are kept to be backward compatible with C. ( that's just my opinion. You can write C style in C++ but that defeats the purpose of writing C++ code)
But you can find use for them even if you write OOP like code.
What a great and amazing definition!!!
Thank you very much 🤗🤗🤗
ma'am please make videos on Data Structures & solution of this quiz problem. Ma'am really love your way of teaching. Just keep going.❤ You are the only one who focus more on foundation. Thank you ma'am.
How do I do it with an user Input? For example the user should input his name, age and so on...and then the console should output the list
dislikers gonna dislike coz they suck at it! thank you ma'am for providing such quality content for free
Hey Saldina. How about you make a video for the solutionof the quiz app. Please 🙏
I am watching the tutorial in june 2022 and the i phone cost is $699 right now. Greetings CodeBeauty. Thanks for your videos they've helped me a lot. I wanna become a software engineer.
Congratulations for getting 63.1K subscribers, keep going on
Yes!!!!!!!!!!!!!!!!!! Make a video we go through it and also add one more example in that video showing how we can store the structures in case we are making lets say a project on cars...whereby at the end we will need to output a kind of form for all cars. Thank Youuuuuu