I know some C++. I just read about new rule. That all C++ has to include using namespace std;
What does it means? What is that?
What does it means? What is that?
code:<HR>Code:#include<string> #include<iostream><P>int main(void) { std::string myString = "Hello world"; std::cout << myString << std::endl; return 0; }
I would for all but the <tt>std</tt> namespace, as anyone clashing with that needs their head examined.Many purists would say you should never bring an entire namespace into scope, in all but the simplest programs, otherwise what is the point of haviong them at all? I think I tend to agree.
code:<HR>Code:std::string myString ;
code:<HR>Code:using std::string;
code:<HR>Code:#include <iostream.h> #include <string.h><P>using std::string;<P>int main() { string strung; cin>>strung; cout<<strung<<endl; return 0; }
#include <iostream.h>
#include <string.h>
That compiler is ancient. It probably doesn't even have namespace support.I don't know how to convince this compiler that there is a string class. it's Borland C++ 4.52, and i suspect that any programs i write MUST be compilable on this version because this is the version that the professor uses.
<big>
#include<iostream><P>int main()
{
using namespace std;
cout << "Hello, Local Using Directives!\n";<P> return 0;
}
</big>
Where are you going to school? That is the compiler I used when I was learning C++. In 1994/1995. It also predates the standard by quite a few years... Ugh.
Quite frankly, I think that's a bunch of crap. Opening a .cpp file in the VS IDE and pressing F5, and clicking "yes" a couple times is too difficult? He could just as easily use "cl hw.cpp -o hw.exe" at the command line.It's just my professor refuses to teach with it. I think he thinks that it's too much overhead to compile our small programs
Quite frankly, I think that's a bunch of crap. Opening a .cpp file in the VS IDE and pressing F5, and clicking "yes" a couple times is too difficult? He could just as easily use "cl hw.cpp -o hw.exe" at the command line.
Um, you don't understand how to use workspaces.
First, if you have two projects (a lib and a test), they should both be in the same workspace. And you can set up dependencies for the test project to allow it to automatically build the right version of the lib you are testing. Or whatever...
or in the least grab the free borland compiler to use as the back end for the borland ide frontend (I think they are switch compatible).
A workspace is more like a project group in bcc (with C++ Builder anyway). Look at it this way:Just create workspaces, forget creating projects (a workspace is just like a project in bcc).

test in the directory