STL Questions
-
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself. Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be? Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks... thanks ben
-
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself. Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be? Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks... thanks ben
It's great. However, you might want to check out http://www.stlport.org since there are some bugs etc. in M$'s impementation.
-
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself. Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be? Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks... thanks ben
I too have recently started using the STL. To use it in a console app you include the appropriate header file(s) (e.g. vector, map, string, etc.) using the angled brackets. The .h is not used when naming STL header files. The difference between using angled brackets and quotation marks is easy. If an include file is in quotation marks the compiler reads it from the current directory. If it is in angled brackets the compiler searchs the include path for the file. >>>-----> MikeO
-
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself. Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be? Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks... thanks ben
I think you're right on the money. It's great that you've taken the time to understand how a linked list is implimented, but now you should go on to use the STL. It is an awesome set of tools, the more I learn about it, the more I wish I had time to learn about it. Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.
-
I too have recently started using the STL. To use it in a console app you include the appropriate header file(s) (e.g. vector, map, string, etc.) using the angled brackets. The .h is not used when naming STL header files. The difference between using angled brackets and quotation marks is easy. If an include file is in quotation marks the compiler reads it from the current directory. If it is in angled brackets the compiler searchs the include path for the file. >>>-----> MikeO
One correction - when #include'ing a file in quotes, if the file isn't in the current directory, the preprocessor then searches the INCLUDE path. --Mike-- http://home.inreach.com/mdunn/ #include "buffy_sig"
-
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself. Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be? Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks... thanks ben
-
Does anyone have any opinions on using the STL... Is there any reason not to use it? I seem to spend a lot of time implementing things like linked lists, but have recently started using the STL. A lot of people take the view that there is no point reinventing the wheel and making things harder for yourself. Although I do like to know exactly how my programs work, am I really just creating more work for myself. Secondly, should I be able to get at the STL in a console app. Im thinking maybe I need to include some header files, which ones might they be? Finally, whilst Im here can I also ask whats the difference between including things with < and >, and in speech marks... thanks ben
Hi. > Finally, whilst Im here can I also ask whats the difference between including things > with < and >, and in speech marks... Easy: #include searches stdio.h in the defined include directories while #include "stdio.h" searches the file first in the current directory and then in the standard include dirs. Thus, use <> for standard files or standard modules you use often and "" for your own files the current project. Karl Pseudocode is code to demonstrate a concept, not designed to be run. Like certain Microsoft software.