If I just include existing Standard C++ class in C++/CLI program, will it work?  In my tests everything worked pretty good, but is it true for every program?
123500
Would a C++  compiler be able to compile some large sets of C++ classes without modifications?   Is C++ CLI a superset of C++?
13126
We have the question   What's the answer for C++?
35935
I'm using the 'using' declaration in C++ to add std::string and std::vector to the local namespace (to save typing unnecessary 'std::'s).  using std::string; using std::vector;  class Foo { /*...*/ };   What is the scope on this declaration?  If I do this in a header, will it inject these 'using' declarations into every cpp file that includes the header?
113810
Newbie here. I just got an error running from the terminal a C++ program I wrote: error: ‘stoi’ is not a member of ‘std’. They told me the compiler is too old.  I'm using Ubuntu 14.04.  My g++ version is 4.8.4.  How do I upgrade?
65547
See also      Not a major issue, just annoying as I don't want my class to ever be instantiated without the particular arguments.  #include &lt;map&gt;  struct MyClass {     MyClass(int t); };  int main() {     std::map&lt;int, MyClass&gt; myMap;     myMap[14] = MyClass(42); }   This gives me the following g++ error:     /usr/include/c++/4.3/bits/stl_map.h:419: error: no matching function for call to ‘MyClass()’   This compiles fine if I add a default constructor; I am certain it's not caused by incorrect syntax.
39126
Is it me or are there no standard trim functions in the c or c++ library? is there any single function that acts as a trim? If not can anyone tell me Why trim is not part of the standard library? (i know trim is in boost)  My trim code is  std::string trim(const std::string &amp;str) {     size_t s = str.find_first_not_of(" \n\r\t");     size_t e = str.find_last_not_of (" \n\r\t");      if(( string::npos == s) || ( string::npos == e))         return "";     else         return str.substr(s, e-s+1); }   test: cout &lt;&lt; trim("  \n\r\r\n \r\n text here\nwith return   \n\r\r\n \r\n "); -edit- i mostly wanted to know why it wasnt in the standard library, BobbyShaftoe answer is great.
99231
I want to make a simple GUI Application. Can anybody give me source code of a simple GUI Application? So far, I have been competing in Programming Competitions (I have been using C++ for it) and now I want to get started with Application Development.
71365
I've been using C++ for a short while, and I've been wondering about the new keyword. Simply, should I be using it, or not?  1) With the new keyword...  MyClass* myClass = new MyClass(); myClass-&gt;MyField = "Hello world!";   2) Without the new keyword...  MyClass myClass; myClass.MyField = "Hello world!";   From an implementation perspective, they don't seem that different (but I'm sure they are)... However, my primary language is C#, and of course the 1st method is what I'm used to.  The difficulty seems to be that method 1 is harder to use with the std C++ classes.  Which method should I use?  Update 1:  I recently used the new keyword for heap memory (or free store) for a large array which was going out of scope (i.e. being returned from a function). Where before I was using the stack, which caused half of the elements to be corrupt outside of scope, switching to heap usage ensured that the elements were in tact. Yay!  Update 2:  A friend of mine recently told me there's a simple rule for using the new keyword; every time you type new, type delete.  Foobar *foobar = new Foobar(); delete foobar; // TODO: Move this to the right place.   This helps to prevent memory leaks, as you always have to put the delete somewhere (i.e. when you cut and paste it to either a destructor or otherwise).
42083
What are the C++ coding and file organization guidelines you suggest for people who have to deal with lots of interdependent classes spread over several source and header files?  I have this situation in my project and solving class definition related errors crossing over several header files has become quite a headache.
32521
I came across this strange code snippet which compiles fine:  class Car {     public:     int speed; };  int main() {     int Car::*pSpeed = &amp;Car::speed;     return 0; }   Why does C++ have this pointer to a non-static data member of a class? What is the use of this strange pointer in real code?
15417
Is there a need to install a C/C++ compiler in Ubuntu 14.04 LTS? Where to write the program? How to compile the same?
50684
I'm starting out in Visual C++ and I'd like to know how to keep the console window.  For instance this would be a typical "hello world" application:   int _tmain(int argc, _TCHAR* argv[]) {     cout &lt;&lt; "Hello World";     return 0; }   What's the line I'm missing?
18906
I am trying to add a timed delay in a C++ program, and was wondering if anyone has any suggestions on what I can try or information I can look at?  I wish I had more details on how I am implementing this timed delay, but until I have more information on how to add a timed delay I am not sure on how I should even attempt to implement this.
36917
Why did MS originally make the decision to maintain these two separate core libs? Maybe they had some scalability issue in mind, but nowadays I never see an application, of any type, that doesn't need both. Does anyone have any inside information on this? It's not really important, but been on my mind for years.  PS. I know what's in the two libs, I know the difference - I'm a big fan of  :) Just wondering what practical use the separation of the two has.
54456
Does anyone know why typedefs of class names don't work like class names for the friend declaration?  class A { public: };  class B : public A { public:    typedef A SUPERCLASS; };  typedef A X;  class C { public:    friend class A;             // OK    friend class X;             // fails    friend class B::SUPERCLASS; // fails };
21092
Is it possible to serialize and deserialize a class in C++?  I've been using Java for 3 years now, and serialization / deserialization is fairly trivial in that language. Does C++ have similar features? Are there native libraries that handle serialization?  An example would be helpful.
62585
Given the following example, why do I have to explicitly use the statement b-&gt;A::DoSomething() rather than just b-&gt;DoSomething()?  Shouldn't the compiler's overload resolution figure out which method I'm talking about?  I'm using Microsoft VS 2005. (Note: using virtual doesn't help in this case.)  class A {   public:     int DoSomething() {return 0;}; };  class B : public A {   public:     int DoSomething(int x) {return 1;}; };  int main() {   B* b = new B();   b-&gt;A::DoSomething();    //Why this?   //b-&gt;DoSomething();    //Why not this? (Gives compiler error.)   delete b;   return 0; }