<div dir="ltr">George,<div><br></div><div>I'm not sure of your background, so I'm not entirely sure where to start, but I'll assume you have fundamental CS training in things like data structures and ADTs, algorithms, etc.</div><div><br></div><div>So here's my explanation and links about the concepts you described:</div><div><br></div><div><ul><li><b>shared_ptr</b></li><ul><li>If you're familiar with so-called "raw pointers" in C++ (those using *, such as in MyClass* something = new MyClass();) then you know some of their limitations</li><li>One major limitation of raw (regular) pointers is that you have to remember to delete them</li><li>Many other languages have so-called automatic garbage collection or something similar where you don't have to manage your own memory (e.g., Java, C#, etc.)</li><li>shared_ptr is a full-fledged class that allows you to point to objects and primitives, but it maintains a reference could and you don't have to remember to delete them later</li><li>Decent references:</li><ul><li><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr">http://en.cppreference.com/w/cpp/memory/shared_ptr</a><br></li><li><a href="http://thispointer.com/learning-shared_ptr-part-1-usage-details/">http://thispointer.com/learning-shared_ptr-part-1-usage-details/</a><br></li></ul></ul><li><b>iterator</b></li><ul><li>In general, the iterator ADT can be seen as a specialized object whose sole purpose is to help you move through (traverse) a collection (data structure), such as a list, multiset, etc.</li><li>Because an <i>index</i> is seen as a simple way to move through an array, an iterator is a bit like an analogous yet more object-oriented way of doing so</li><li>The term "index" wouldn't really be appropriate for say, a linked chain of nodes (e.g., in a linked list, linked bag/multiset, dictionary) so an iterator is used to traverse such a container, and is in fact, more general than an index, since an index is array-oriented</li><li>References:</li><ul><li><a href="https://www.cprogramming.com/tutorial/stl/iterators.html">https://www.cprogramming.com/tutorial/stl/iterators.html</a><br></li><li><a href="https://en.cppreference.com/w/cpp/concept/Iterator">https://en.cppreference.com/w/cpp/concept/Iterator</a><br></li></ul></ul><li><b>const</b></li><ul><li>This keyword is used in many different scenarios, so I'm not sure what your context is</li><li>const, when used in front of a declaration indicates that the "variable" is actually a constant and cannot be changed (e.g., const int someVar = 150;)</li><li>const, when used after the name of a member function (method) inside a class means that <i>that method</i> cannot change the internal data of the object (e.g., void someFunction() const;)</li><li>const, when used with raw pointers has many different meanings</li><ul><li>const int* myPtr   // pointer to an integer whose value is constant (you can change the pointer to point to something else, but can't change the value of the int it points to.)</li><li>int* const myPtr  //a constant pointer to an integer (you cannot change what the pointer points to, but you can change the value at the memory address to which it points)</li><li>const int* const myPtr  //you can neither change what it points to (i.e., the address) nor the value to which it points </li></ul></ul><li><b>auto</b></li><ul><li>This isn't really a data type per se.  It's called a <i>specifier</i></li><li>Although C++ is a <i>strong-typed </i>or <i>strict-typed</i> language (meaning a variable is declared with a type and can only hold that type), auto can be used to deduce the type from the initializer</li><ul><li>auto myVar = 15;  //compiler will deduce that this is an integer</li><li>auto yourVar = 3.14159;  //compiler will deduce this is a float</li></ul><li>However, you don't usually use it with simple types like that - it's frequently used with more complex types, those using templates, etc.</li><li>It's used in some other contexts, but I think the above is probably the most common usage</li><li>See <a href="https://en.cppreference.com/w/cpp/language/auto">https://en.cppreference.com/w/cpp/language/auto</a></li></ul></ul><div><br></div><div><br></div></div><div>Hope this helps! :)</div><div><br></div><div>Dr. John P. Baugh</div><div>University of Michigan - Dearborn</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 5:17 AM, george assaf <span dir="ltr"><<a href="mailto:engdotgeorge@gmail.com" target="_blank">engdotgeorge@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">

<span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi All,</span><div style="text-decoration-style:initial;text-decoration-color:initial">I need a good reference for C++ programming and in particular contains information about the advanced following concepts:<span> </span><b>shared_ptr</b>,<span> </span><b>iterator<span><wbr> </span></b>,<span> </span><b>const<span> </span></b>descriptor ,<span> </span><b>auto<span> </span></b>type ...</div><div style="text-decoration-style:initial;text-decoration-color:initial">I would be grateful to you..</div><div style="text-decoration-style:initial;text-decoration-color:initial">thank you</div>

<br></div>
<br>______________________________<wbr>_________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/<wbr>mailman/listinfo/ndnsim</a><br>
<br></blockquote></div><br></div>