09:01:46 From Glenn Downing : 4321 09:02:46 From Glenn Downing : Quiz: 4321 09:12:29 From Ohana Benevides (she/her) : I know the idea is just that we could quickly go over the questions with our peers but I still think the time is quite short for that. Any chance we can get a bit more time next time? 09:29:41 From Jaiden Parlone : Watching us all with the i of the tiger 09:58:21 From Andres Vargas : What would be the address for "abc"? 09:59:09 From Andres Vargas : I mean, address of e.what() makes sense to me, but what about the hard coded "abc"? 10:02:34 From Andres Vargas : My mic seems to be not working :/ 10:05:30 From Marc Paterno : The literal “abc” is similar to a literal 2; it is an rvalue, and not something for which you can take an address. 10:12:47 From Abhilash : What is the difference between char* and string ? 10:19:40 From Qiming Lu : char* is an address pointing to a variable of type char, or an array of chars. while string is a C++ class type 10:20:01 From Anthony Tiradani : Is string a built-in? 10:20:07 From Barbara Yaeggy : Char is a single alphabet where as String is a sequence of characters. Char is primitive datatype where as String is a class. 10:20:37 From Iker Loic De Icaza Astiz : String is part of std. You access it with: 10:20:43 From Iker Loic De Icaza Astiz : std::string s; 10:25:20 From Barbara Yaeggy : char is one character. String is zero or more characters. char is one character. String is zero or more characters. char is one character. String is zero or more characters. char is a primitive type. String is a class. 10:25:32 From Marc Paterno : C++ does not use the terminology “built-in”. It uses the term “primitive type” (such as int, double, char). std::string is not a primitive type; it is a class type. In this case, the class happens to be provided by the standard library. 10:26:00 From Andres Vargas : so what's actually happening behind the scenes is string(e.what()) == string("abc") 10:26:02 From Carlos Rimola : char c = 'C'; // is a single character/alphabet but "abc" is a *character string* (multiple chars) That makes the implicit conversion possible 11:36:29 From Lorena Lobato Pardavila : Would it be valid the solution without specifying the ¨const¨? 11:39:23 From Marc Paterno : The tests would all pass. Using ‘const’ to indicate that the argument will not be modified is important for other reasons, that Glenn will get to later in the course. 11:39:42 From Iker Loic De Icaza Astiz : If by valid you mean passing the tests, yeah it would be. We passed the test without it. 11:41:36 From Abhilash : Why are we worried about modifying it? We know we are not doing any operations on those variables in this piece of code. Is it inculcate good programming practice ? 11:44:38 From Carlos Rimola : That is the point of passing it as const, a good programming practice if you know the argument variable should not and will not be altered within that function 11:48:57 From Abhilash : Thanks :) 11:49:29 From Haejun (Stella) Oh : Is the point of ++a and ++b to index the string and to move on to the next character of the string? 11:49:37 From Andres Vargas : same question I have :) 11:50:05 From Andres Vargas : is not 'a' being modified by '++a'? 11:51:52 From Qiming Lu : char const* is a pointer to a const char, meaning the value being pointed to will be a constant, but you can still change the pointer itself 11:52:05 From Saba Sehrish : It is not modifying a but incrementing address 12:02:23 From Kesavan : shouldn't 1 (or) 1 be 1? 12:03:08 From Ken Herner : for OR, yes, but for XOR, no. 12:05:31 From Marc Paterno : | is (bitwise) or; ^ is (bitwise) exclusive or, or as Ken called it xor. 12:06:42 From Carlos Rimola : The 3 XORs are the equivalent of swap(a, b)! 12:25:20 From Abhilash : Can someone remind me what is A ? 12:26:14 From Qiming Lu : A could be any primitive type, or a class type 12:26:24 From Andres Vargas : And z? 12:27:03 From Qiming Lu : z here is a pointer of the type A*, defined in line 203 12:43:50 From Carlos Rimola : Is - delete a; valid? Equivalent to delete [] a;? 12:44:08 From Andres Vargas : no 12:44:09 From Marc Paterno : No, delete and delete [] are not interchangeable. 12:45:04 From Marc Paterno : If you have used array new (new []) you must use array delete (delete []). But later in the course Glenn will be showing things you should be using rather than C-style arrays (std::array and std::vector, for example). 12:45:16 From Carlos Rimola : Because a, is an array? 12:46:53 From Marc Paterno : You must use delete [] a because it is an array. 12:49:06 From Ken Herner : I remember having to write things like, if ( ) delete ; // as opposed to just "delete ;" 12:50:59 From Carlos Rimola : I believe that is valid because TSomething is an instance of a class (an object) and not an array 12:55:45 From Marc Paterno : No, delete called on a null pointer is always OK, including when the pointer is a pointer to a class type. Unfortunately, old ROOT documentation and examples contains many examples of poorly implemented code. It is inefficient to test that the pointer is non-null, because delete has to check anyway. 12:58:52 From Ken Herner : Certainly possible that older root version (this would be have been in the early 5.x series and older). 12:59:52 From Ken Herner : did not implement things quite correctly. Lots of 4.x back in the day for me, too. 12:59:59 From Marc Paterno : Yes, older ROOT versions also had troubles with the “C++ interpreter” not implementing the same rules as standard C++. It was a terrible tool for learning C++, because it would teach so many wrong lessons. 13:00:37 From Ken Herner : That's probably it, then. Thanks Marc and Carlos.