Trying to learn...C++ in VS .net
Hiya,
I have very limited programming experience from years back on a particular programs internal programming/scripting language that was kinda a basic/c++ mix (so they said.)
I'm looking to get into C++ so I picked up a copy of Visual C++ .net a little while back.
I found some nice tutorials on the net, such as the ones on this site, though I'm confused as to how to get up and running with them. I type in the code - reading what the code is supposed to do, but then it errored out in Visual Studio. Upon exploring it a bit, it seemed that virtually ALL tutorials reference "iostream.h" I did a search and found the file on my HD and added it to my resources of the project... should I have done that? I would have imagined th at simply including the iostream.h in the start of my code would have been enough for VS to search its main paths for the file... I believe it compiled finally, though it still presented errors that I have yet to examine closely... aside from that though...
I guess what I'm asking is, is it just me or is this an extremely confusing language to learn considering that one can't even rely on a few lines of the simplest code to work because it may be different from one compiler to another? From a small blurb that I read in the VS.net help, it sounded like it said that they were doing away with the iostream.h all together. If so, then what do I use instead when the tutorials reference? Would "cout" still work or would I need another word for that too? ;/
Perhaps for an experienced C++ programmer, they can easily identify what is different from one compiler to the next, but to a beginner, it's extremely difficult to try and follow step-by-step instructions and then to find out they don't work for their particular programming environment/compiler.
Any advice on what to study in order to learn C++ .net? I can't really afford another book right now. I just want to get started with some basic tutorials, but again - I'm finding that they don't seem to be working right out of the box. So any assistance/direction would be greatly appreciated.
Thanks!
drez
Re: Trying to learn...C++ in VS .net
Quote:
Originally posted by drez
Hiya,
I have very limited programming experience from years back on a particular programs internal programming/scripting language that was kinda a basic/c++ mix (so they said.)
I'm looking to get into C++ so I picked up a copy of Visual C++ .net a little while back.
.NET 2002 or .NET 2003? The new one is better.
Quote:
Upon exploring it a bit, it seemed that virtually ALL tutorials reference "iostream.h"
Because those tutorials aren't up-to-date. "iostream.h" was removed from the C++ language (and replaced with "iostream") in 1998.
Quote:
I guess what I'm asking is, is it just me or is this an extremely confusing language to learn considering that one can't even rely on a few lines of the simplest code to work because it may be different from one compiler to another?
The problem is really that the C++ language itself changed and grew. They made some incredible improvements, things that had been in the works for many years, and the C++ language was much better for it. It also means, though, that pre-1998 C++ code isn't standard anymore.
Here is an example of a pre-C++98 code:
Code:
#include <iostream.h>
int main(){
cout << "Hello World!" << endl;
return 0;
}
and the equivalent in modern C++:
Code:
#include <iostream>
using namespace std;
int main(){
cout << "Hello World!" << endl;
}