The purpose of this channel is to support the courses I teach or have taught at Diablo Valley College, Los Medanos College, Ohlone College, and California State University East Bay.
These videos are not a comprehensive resource. That is to say, they are supplemental resources to the courses I teach, not replacements for the courses themselves. Not all topics covered by the courses will be covered in these videos.
These videos are not intended as a replacement for reading the text or attending lectures.
Any educators who would like to use these videos for their classes are welcomed to do so.
There isn't a chapter 1 since in our text, chapter 1 is just talking about basic things like what is an IDE, what is memory, and so forth. There really isn't any coding examples. If you are following the playlists, you can start with chapter 2 play list.
Could we do something like this to save some memory or just save some lines of code? Or is this less efficient? #include <iostream> using namespace std; int main() { int number = -1; while (number <= 0) { cout << "Enter a positive number: "; cin >> number; if (number <= 0) { cout << "Input must be positive. Try again! "; } } cout << "The number you entered: " << number << " "; cin.ignore(); cin.get(); return 0; }
You're not saving memory, and your code actually executes twice as slow as you double the number of tests. You check number twice per iteration instead of once. Good question.
@@ProfessorHankStalica Would you ever consider tutoring for a price? I really wanna peruse coding for a job one I go to university. And you are by far the best teacher I've seen in regards to CS. You take the time to explain all the little bits. And it's been really helpful
@@sebastianviecco6891 You sir are too kind! I've thought about doing paid tutoring in the past, but I'm so busy at the moment I couldn't take on anything new right now.
Excuse me, sir, I've tried doing it, but in the inner for loop, I started with element 0 instead of 1, and it doesn't work, can you, please, tell me what's wrong with my code? (if you have time of course) and thanks so much for the great content 💛💛 here is the code: void bubblesort(string s[], int size) { bool flag; string temp; do { swapflag = false; for (int i = 0; i < size; i++) { if (s[ i + 1 ] < s[ i ]) { temp = s[ i ]; s[ i ] = s[ i + 1 ]; s[ i + 1 ] = temp; swapflag = true; } } } while (swapflag); }
Depends on what you mean by doesn't work, but most likely a logic error. Here's a video I did showing you how to find and fix logic errors: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-anhoM2eLkpc.html In your case, it's an off-by-one error, which you'll easily see if you trace your code.
Thank you. I started in a reading chapter for this topic and could not for the life of me know what was being said. Sadly the downsides of online courses, you have no one to ask questions to.
6:02 I would not introduce lamdas showing an '[ ] { }' example. and I would not call it the basic version, as it is a specialized version of the general form of a lamda, when it does not use/needs any arguments. I would show the general form of a lambda '[ ] ( ) { }' with its capture, the argument list and the function body. this also has the advantage to literally see, that a lamda is an unnamed function. a function has the form of 'function_name (argument-list) { function_body }', but the lambda has no function_name and is preceded by the capture, thus having the form '[ capture-list ] (argument-list) { function_body }'. recognizing such analogies helps to understand (at least for me), that lamdas are just anonymous functions (with some specialities).
It's a Java style thing. You could just return length or width. Java practice has you be explicit as possible out everything. If I were writing C++, I probably wouldn't use this.
I have a lot of doubts, the first one would be, why are there three objetcs (ifstream,ofstream,fstream)? it did seem like fstream was like the base one and ofstream was text by default, but it seems fstream is also text by default so I don't get the point of ofstream, my other doubt would be, what would the equivalent of fseek be in binary files? also I did understand why you couldn't write the whole array in the function as the sizeof operator returned 8 bytes, what I don't understand is why that wasn't a problem before, also I don't understand why the first argument of the write method has to be of type char* casting pointer types sounds dangerous, also this is not a doubt but more of a wish, since we also saw in this video how to write to text files it would've been cool to see how to read them, another doubt is why when working with textfiles you opened it as a .dat instead of .txt and how did it work anyways, and lastly another comparison to the C function idk why the third argument of how many times to read said number of bytes was removed, it was anyways a great introductory video, but I have all this doubts
Excellent tutorial! I tried to understand the same concept through reading some blog articles online but didn't fully grasp the concepts that you discussed in clear, simple level of understanding in this video. Thanks again!!
To force derived classes to use the public interface of the base class. This makes the class more resilient so it can't go around any type of validation code that might be in methods that make up the public interface of the base class. The downside is it is slower to access those inherited variables, but that's the trade off you make. Safety vs speed.
@@ProfessorHankStalica so now it is clear i thought when i make a private access specifier with inherited constructor that i can not access it publicly but now i understand that i could (so i ll call the constructor in the public interface of the base class so this will ensure that i dont make any unnecessary changes by fault when calling the constructor as it will have the specefiers and properties within the base constructor) and thanks for your time .
@@ProfessorHankStalica thank you! What prompted my question is that I heard someone talk about the world being a "model" of a formal system as if the model were itself an assignment of values to variables, whence my confusion. I encountered something similar in an Intro to Logic book I read years ago. Logicians seem to have this backwards way of talking about "models" that confuses me. In engineering, we think of models as abstractions that describe empirical data. But logicians talk as though models *were* the empirical data. I'm talking vaguely, of course, with a view from 30,000 feet up. I just want to get the general idea.
4 bytes for an int, 2 bytes for a short, 1 byte for a char, and 8 bytes for a long long. Although, technically it can vary based on architecture. Most modern systems will have the above. doubles are 8 bytes and floats are 4 bytes. see: en.cppreference.com/w/cpp/language/types