I #include these headers:
#include <iostream>
#include <fstream>
but however this piece of code:
ifstream inFile;
still wont compile. what could be the problem? Im using Visual Studio 2010, Win32 C++.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can put a
using namespace std;at the top of your code so you don’t have to fully qualify standard C++ stuff, but it’s considered bad form by a large number of developers.I simply prefix the standard stuff with
std::, which makes the code longer:but keeps me out of trouble vis-a-vis namespace clashes.
The following transcript shows the use of
std::prefixes in action: