Top "Std" questions

The C++ Standard Library, and its namespace.

How to find out if an item is present in a std::vector?

All I want to do is to check whether an element exists in the vector or not, so I can …

c++ vector std
Why is "using namespace std;" considered bad practice?

I've been told by others that writing using namespace std; in code is wrong, and that I should use std::…

c++ namespaces std using-directives c++-faq
printf with std::string?

My understanding is that string is a member of the std namespace, so why does the following occur? #include <…

c++ string namespaces printf std
Replace part of a string with another string

Is it possible in C++ to replace part of a string with another string? Basically, I would like to do …

c++ string replace substring std
error C2065: 'cout' : undeclared identifier

I am working on the 'driver' part of my programing assignment and i keep getting this absurd error: error C2065: …

c++ namespaces visual-studio-2010 std
cout is not a member of std

I'm practicing using mulitple files and header files etc. So I have this project which takes two numbers and then …

c++ io std member cout
Why am I getting string does not name a type Error?

game.cpp #include <iostream> #include <string> #include <sstream> #include "game.h" #include "board.h" #…

c++ string std
What is the use of "using namespace std"?

What is the use of using namespace std? I'd like to see explanation in Layman terms.

c++ namespaces std using
Can you remove elements from a std::list while iterating through it?

I've got code that looks like this: for (std::list<item*>::iterator i=items.begin();i!=items.end();…

c++ list std
cc1plus: error: unrecognized command line option "-std=c++11" with g++

I'm trying to compile using g++ and either the -std=c++11 or c++0x flags. However, I get this error …

c++ c++11 compiler-errors g++ std