1

should one know about pointers,objects,classes,structs and such to learn STL,what are the full prerequisites?

BaherZ
  • 69
  • 1
  • 1
  • 6
  • 3
    You can learn to use the standard library before learning what pointers, objects, classes and structs are... because learning how to use `std::vector` is lot less complex than the language rules. –  Feb 06 '15 at 06:28
  • 1
    The STL should be learned right from the beginning imho. Many many books/tutorials teach C++ backwards by presenting the complex pointer stuff at the beginning rather than toward the end with the more advanced concepts. – Galik Feb 06 '15 at 06:31
  • Learn from Ground dont jump on STL on first step , **here** [link] [(http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)] – test program Feb 06 '15 at 08:32

3 Answers3

1

I would say that you should having a working knowledge of C++, some domain experience where you have or plan to use your programming skills, plenty of patience (since you are trying to exploit any shortcuts you can take), and be prepared to learn about objects, structs, classes etc. as you get stuck.

The simplest exercise: think of a small problem such as finding the running mean, median and mode of a set of numbers. This should be moderately easy, since it require no special domain expertise. Learn C++ enough to figure out how to solve this.

As you learn about STL, try to solve the same problem formulated in that context. You'll find yourself gaining confidence and knowledge.

Shripathi Kamath
  • 310
  • 3
  • 10
1

Yes, one should definitely have a basic knowledge of the most common C++ elements, such as the usage of * and & with pointers, objects, etc. to be able to use the STL correctly.

In C++, it should be preferred to use objects from the STL wherever possible, such as smart pointers instead of raw pointers, std::strings instead of raw char arrays, std::vectors instead of raw arrays, etc.

In conclusion, handling the basics of the language with a good knowledge of the STL should go a long way.

Emil Laine
  • 41,598
  • 9
  • 101
  • 157
0

I would suggest you to learn pointers, structure, dynamic memory allocation and Linked List to better understand STL.

Try yourself to implement Stack and Queue using Array and Linked List.

CreativeMind
  • 897
  • 6
  • 19