Question:
Very basic C++ questions?
2011-03-31 19:27:28 UTC
I want to start learning C++, I can find a ton of online tutorials but what the hell do I write it into? Just notepad? and if so then what file extension do I use? I tried just putting it into Notepad and saving it as .exe, that didn't work. Can someone help me out a little here please.
Three answers:
2011-03-31 19:37:16 UTC
The common C++ extension is .cpp; that's the extension you use for all C++ source files. You *can* use notepad, but you're probably better off using an editor like Vim or GNU Emacs.



EDIT: Also, you can't just save it as an executable file, you need to compile it with a C++ compiler such as gcc (http://www.mingw.org/ ).
B.R.
2011-04-01 02:47:32 UTC
For C++ your file extensions will be "cpp" (i.e. my_program.cpp) You can use Notepad if you like, just make sure to explicitly set the file extension otherwise it will detault to "txt".



Starting out you might also want to take a look at Notepad++ which is a pseudo IDE (Integrated Development Environment). You will also need to download a C++ compiler - I think GCC has an opensource Microdust version.



Once you get started in learning the basics you might eventually want to use a more "professional" IDE such as Eclipse, Netbeans, or IntelliJ which all have plugins for C++ but are more natively geared for Java development. I think most MS people use Visual C++ but that usually cost money unless you are taking a course and your school has a subscription to MSDN.



-br
eric p
2011-04-01 02:33:27 UTC
to start c++, first you need a c++ compiler, like gcc or vc, after your write a souce file, you compile and link it to static or dynamic library to make it run properly.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...