New to C++
Hello. I am very new to the C++ language. I know absolutly nothing about C++ but I want to learn. I have a few questions though:
Is this the right forum that a very new person should be on to learn?
Is there a better forum or site that would suit my needs better than this one?
I know that I need a compiler for programming but I have no idea where to get one or what one would be good for a beginner. Can you help me find one?
I apoligize for being very new and asking very newbie questions if this forum is meant for advanced learners but I really have no idea what I am doing. LOL
Thanks in advance.
i think this is a very good C/C++ forum website. (or i wouldnt visit it!)
for a compiler and IDE, there are many, free and commercial. a nice small one is Dev-C++. visit here for the download page. scroll down to 'downloads' and the one you want is the first one in the list: Dev-C++ 5.0 beta 9.2 (22.214.171.124) (9.0 MB) with Mingw/GCC 3.4.2. when it asks you during the install/setup for code completion (or something similar) choose to turn it on.. itll be helpful in the future eventually.
dev-c++ is for windows, if your on linux then 'g++' is probably already installed and is the best one ive used. (although ive only used like 3 different compilers).
here are a few great links (from this domain) with tons of information, to start learning and following along:
Getting Started with C++
when you run into a problem, it is usually quickest to search forums for the answer. if you cant find it, make a thread in the appropriate forum. be sure to give a descriptive (but short) thread title, include any relevant code your working on, and include all complete error/warning messages you receive.
good luck! :)
I too am new and trying to learn C++ for fun, however the whole compiler thing has me baffled. I tried to do that quick tutorial on "how do I us a compiler", followed it word for word, but nothing happened. I have also tried the watcom compiler with IDE and had the same issues. Any ideas on how I can figure out how to use a compiler so I can learn C++?
First thing to learn is how to communicate with other humans properly in context of programming. You'll find that the reason you have trouble with programming later on is sometimes because you fail to think things through properly. This is just what many newbie programmers go through because they have trouble thinking in "verbose terms", if I'm allowed to make that term up. :)
Originally Posted by JimRoach
When you tell us "nothing happened" when you tried to setup a compiler, that means nothing to us. If you are having car trouble, and you tell the mechanic that it "doesn't work", or that "nothing happens" when you try to start it, he has to look at it himself or ask you 20 questions until you tell him more about the problem for him to give a proper diagnosis. Try telling a doctor that your arm doesn't work. If it turns out that you mean you experience pain while moving it, you should say exactly that. ;)
Try to give more details about your problems. Explain to us what you've done already, and we should be able to better help you. :)
Lastly, enjoy C++, and programming in general, and welcome to cboard. ;)
in other words read this!!!
It'd be great if there was some way of forcing people to read that doc before starting programming. Perhaps with eyelids held open and Beethoven played loudly....
MacGyver: I opened a new project, created a filename then typed in the code as shown, as follows:
cout<<"the Compiler Works";
I get message that project compiled successfully, but that's it. I guess I was expecting it to do something, you know, how they always do that Hello World example. I guess I was expecting some text windo to open with that printed out.
Whatever source you got that code snippet from, stop reading it, it teaches ancient C++.
I ditto that. Non-standard C++ is evil.
Also, in the same menu item you used for Compiling, click on the Run button. It will run the program.
Actually, I got that code snippet from this web site. But I also tried the first one under the tutorials. I forgot to add that I hit execute and run, which is what confused me, because I was expecting something to happen.
Something like this should work I think, from the command line.
std::cout << "Hello, world" << std::endl;
> Actually, I got that code snippet from this web site.
Yes, you'll find that, despite the current standard being ratified in early 1998, pre-ISO C++ is still very pervasive. Even this website had tutorials written in pre-standard C++ until about 2 years ago.
Before asking a technical question by e-mail, or in a newsgroup, or on a website chat board, do the following:
Originally Posted by ChaosEngine
Try to find an answer by searching the archives of the forum you plan to post to.
Try to find an answer by searching the Web.
Try to find an answer by reading the manual.
Try to find an answer by reading a FAQ.
Try to find an answer by inspection or experimentation.
Try to find an answer by asking a skilled friend.
I tried all of the above, and could not find an answer, which is why I looked on a thread of another person expressing questions in the same vein.
Yes, but your description of your problem was sorely lacking, to put it mildly.
So, did the code I give you work? If not, what did you try? What did you expect it to do? What actually happened?
Maybe everything worked, and the problem is the screen flashes for a moment before disappearing. The "hello world" was momentarily visible, but then nothing.
Mmm - I've read this somewhere before - the letters 'F' 'A' and 'Q' have something to do with it as I recall :rolleyes:
ok, you are right, I needed to be more specific.
I may not have done it right, what you recommended was to try it from the command line, so, I opened the command prompt, I am using Windows XP, Media addition @ the C:\ prompt I got a Syntax error after typing the first line: #include <iostream>. So I typed in edit at the prompt, got the test editor....as you can imagine I was pretty much lost from there.
I also tried the code you gave me on my compiler(I am using Dev-C++4) Under execute, then compile, after compiling clicked on run. Now I get a message at the bottom(under compiler) that the project compiled successfully. and under the compile log, that it both compiled and linked.
However, that is it. I guess I was epecting some text file or new window to pop up saying "Hello World". I think I am just completely lost and befuddled.