This question already has answers here:
What is the difference between "VC++" and "C++"?
(10 answers)
Closed 9 years ago.
What is the difference between C++ and Visual C++?
I know that C++ has the portability and all, so if you know C++ how is it related to Visual C++? Is Visual C++ mostly for online apps? Would Visual Basic be better for desktop applications?
C++ is a standardized language. Visual C++ is a product that more or less implements that standard. You can write portable C++ using Visual C++, but you can also use Microsoft-only extensions that destroy your portability but enhance your productivity. This is a trade-off. You have to decide what appeals most to you.
I've maintained big desktop apps that were written in Visual C++, so that is perfectly feasible. From what I know of Visual Basic, the main advantage seems to be that the first part of the development cycle may be done faster than when using Visual C++, but as the complexity of a project increases, C++ programs tend to be more maintainable (If the programmers are striving for maintainability, that is).
C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language and originally named "C with Classes". It was renamed to C++ in 1983.
C++ is widely used in the software industry. Some of its application domains include systems software, application software, device drivers, embedded software, high-performance server and client applications, and entertainment software such as video games. Several groups provide both free and proprietary C++ compiler software, including the GNU Project, Microsoft, Intel, Borland and others.
Microsoft Visual C++ (often abbreviated as MSVC or VC++) is an integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages. MSVC is proprietary software; it was originally a standalone product but later became a part of Visual Studio and made available in both trialware and freeware forms. It features tools for developing and debugging C++ code, especially code written for Windows API, DirectX and .NET Framework.
So the main difference between them is that they are different things. The former is a programming language, while the latter is a commercial integrated development environment (IDE).
C++ is a programming language and
Visual C++ is an IDE for developing with languages such as C and C++.
VC++ contains tools for, amongst others, developing against the .net framework and the Windows API.
C++ is a language and Visual C++ is a compiler for that language. Certainly, it (and every other compiler) introduces tiny modifications to the language, but the language recognized is mainly the same.
VC++ is not actually a language but is commonly referred to like one. When VC++ is referred to as a language, it usually means Microsoft's implementation of C++, which contains various knacks that do not exist in regular C++, such as the __super keyword. It is similar to the various GNU extensions to the C language that are implemented in GCC.
What is the difference between c++ and visaul c++?
Visual C++ is an IDE. There's also C++Builder from Embarcadero. (Used to be Borland.) There are also a few other C++ IDE's.
I know that c++ has the portability and all so if you know c++ how is it related to visual c++?
C++ is as portable as the libraries that you use in your C++ application. VC++ has some specialized libraries to use with Windows, so if you use those libraries in your C++ application, you're stuck with Windows. But a simple "Hello, World" application that just uses the console as output can be compiled on Windows, Linux, VMS, AS/400, Smartphones, FreeBSD, MS-DOS, CP80 and almost any other system for which you can find a C++ compiler.
Injteresting fact: at http://nethack.org/ you can download the C sourcecode for an almost antique game, where you have to walk through a bunch of mazes, kick some monsters around, find treasures and steal some valuable amulet and bring that amulet back out. (It's also a game where you can encounter your characters from previous, failed attempts to get that amulet. :-) The sourcecode of NetHack is a fine example of how portable C (C++) code can be.
Is visual c++ mostly for online apps?
No. But it can be used for online apps. Actually, C# is used more often for server-side web applications while C++ (VC++) is used for all kinds of (server) components that your application will be depending upon.
Would visual basic be better for desktop applications?
Or Embarcadero Delphi. Delphi and Basic are languages that are easier to learn than C++ and both have very good IDE's to develop GUI applications with. Unfortunately, Visual Basic is now running on .NET only, while there are still many developers who need to create WIN32 applications. Those developers often have to choose between Delphi or C++ or else convince management to move to .NET development.
Key differences:
C++ is a general-purpose programming language, but is developed from the originally C programming language. It was developed by Bjarne Stroustrup at Bell Labs starting in 1979. C++ was originally named C with Classes. It was renamed C++ in 1983.
Visual C++, on the other hand, is not a programming language at all. It is in fact a development environment. It is an “integrated development environment (IDE) product from Microsoft for the C, C++, and C++/CLI programming languages.” Microsoft Visual C++, also known as MSVC or VC++, is sold as part of the Microsoft Visual Studio app.
Related
I recently got tasked with writing Windows user mode drivers for our devices and have a good grasp of the WDF and UMDF basics, after reading up on the topic and studying the template projects in Visual Studio 2017.
I'm determined to use as much modern C++ as possible, and if that can include the standard library too, then I'll be much happier than if I need to make my own corresponding functionalities.
Are there any best practices around using modern C++ in Windows user mode drivers in general, and using modern C++ standard library features in specific?
What are the pitfalls I need to look out for, that can be circumvented?
Should I avoid it completely? If so, on what grounds?
Can C++builder compile any c++ source files.
I don't have a good knowledge in c++. but i have some experience in delphi.
I like to use c++ but confused which one to use
I know that cbuilder has vcl , easy to develop ,easy for delphi developer
But my problem is can it compile any c++ files (vc++ and other source files).
is it compatible with vc++ (excluding MFC and VCL). Can i use any APIs with c++builder
You'll find C++ Builder very comfy coming from Delphi if you don't care about MFC or .NET via C++/CLI etc and just want native C++ then either will work for you. Visual Studio 2010 supports a lot of the new C++0x features which is pretty nice, although they don't have variadic templates yet. I'm not sure how much of C++0x is in C++ Builder as yet but that could be worth looking into as a deciding factor.
It should be able to compile any standards conforming code. If the code uses extensions that another compiler provides, it will more than likely have problems. VC++ has quite a few extensions that are on by default and so someone using that compiler might use them with out realizing what is going on(the same applies to G++ the other major C++ compiler out there.)
In my experience, C++Builder's support for more advanced C++ code is limited. For example, many of Boost's libraries are unsupported in C++Builder, and I've often had to modify other open source libraries to get them to build properly in C++Builder (due to various bugs or limitations in C++Builder's compiler). Simpler C++ code can work without any problems.
So, depending on what C++ libraries / source files / APIs you're wanting to use, getting them to work in C++Builder may be very straightforward, or it may take significant work.
You can download a free version of C++ Builder at www.embarcadero.com. With that, you can test your libraries for compatibility.
I've been spending my "inbetween" time at the office looking into C++. I'm primarily a flash & web developer, also working on a bunch of flash games, but I thought it was time to have a look at some non-web-based languages and see if I could get some real games going.
I've got the hang of how typing works, arrays, outputting using cout, structs, classes and so on and so on.
I seem to have found myself stuck in terms of what I can do next. Outputting to a DOS window obviously isn't that exciting - how do I get started on doing something graphical? A square moving around on the screen, even. Simple is better in this case.
As for the compiler - I've been using devcpp by Bloodshed; is this adequate or am I missing a more common compiler somehow?
Graphics can be done using DirectX in Windows, or OpenGL on every platform. It's a whole different discussion upon which to choose.
In addition to trying to work with graphics, you could try your hand at developing GUIs. I'd give Qt a shot. Be warned though, Qt is being sold by Nokia, but it's overall a very well known and heavily used framework. Or try direct Win32 (not necessarily something I'd suggest unless you're interested). Or try WinForms (requires .NET experience, and steals from the true C++; C++/CLR is NOT the same C++ you are learning--it adds to it). If you do go the .NET route, avoid "Managed C++" examples, as they that was the first iteration of C++/CLR, and they simply redid it and vastly improved it.
Two most common compilers: gcc (Linux, Mac and Windows) and Visual Studio's for development on Windows', I always use Visual Studio (there is a free version called Visual Studio Express that is a solid product) for Windows development simply because I love the IDE.
For a compiler, my school uses g++, an excellent, free C++ compiler that is compatible with many IDEs for unix-based C++ development. If you're running a windows machine, you'll have to download cygwin (which emulates a linux shell) - you'll have to select which executables you want to download with the cygwin shell, figuring out what items you need may take a little time (basically, download useful looking things for the type of development that you want to do; g++/gcc are very important).
http://cygwin.com/install.html
When you have this, you can easily configure netbeans or eclipse (I've had better experience with netbeans) to compile and run your C++ code through cygwin.
Also, my favorite resource for learning C++ has been cplusplus.com - it has detailed tutorials of all of C/C++'s standard functions.
Hope this helps a little!
Have a look at graphics and windowing libraries. For windowing, as you seem to be on Windows, there's builtin stuff. For more general applicability I suggest having a look at Qt or Gtk.
For graphics, the fancy stuff is usually done in either DirectX (basically Windows only) or OpenGL (more portable).
Compilers: GCC is commonly used in the Unix/Linux world and also available on Windows through Cygwin. In the Windows world you'll also find Microsoft's MSVCC as it comes with their development tools. Btw., there are free dev tools from Microsoft as well, see their Visual Studio Express Editions.
Some tips:
Work through one or more good books. I recommend "Accelerated C++" and "Effective C++". These books will teach you real C++ programming.
If you're on Windows then I think you're better off using Visual Studio. The learning curve for C++ is steep enough already. If you simultaneously need to learn how to work with gcc and makefiles then you are likely to become overwhelmed.
Windows specific: for simple graphics I find WinAPI and GDI+ useful. They are relatively easy to learn and they are immediately available.
Can I do Android programming in C++, C? If the answer is "yes" then please tell how? And what's the procedure to set up?
I don't know Obj-C, Java, but well-versed in C, C++, Flash AS3, SDK released by Google.
Please do not tell about NVDIA SDK it's not fully developed :)
PLEASE NOTE: THE ANSWER BELOW IS HORRIBLY OUTDATED, AND MIGHT NOT BE ENTIRELY CORRECT ANYMORE.
You can program in C/C++ using the Android NDK. You'll have to wrap your c++ codebase in a static library and load that through a Java wrapper & JNI.
The standard NDK does not support RTTI and a lot of the functionality of standard c++ is also not available such as std::string, etc. To solve this you can recompile the NDK. Dmitry Moskalchuk supplies a modified version of the NDK that supports this at http://www.crystax.net/android/ndk-r3.php. This modified version works on all Android phones that run on an ARM processor.
Depending on the kind of application you should decide to use Java or C/C++. I'd use C/C++ for anything that requires above average computational power and games -- Java for the rest.
Just pick one language and write the majority of your application in that language; JNI calls can decrease your performance by a lot. Java isn't that hard though -- if you know how to program in C/C++. The advantage of Java is that the application can run on any device running Android, where as NDK applications depend on the architecture it was compiled for.
You should use Android NDK to develop performance-critical portions of your apps in native code. See Android NDK.
Anyway i don't think it is the right way to develop an entire application.
Yes, you can program Android apps in C++ (for the most part), using the Native Development Kit (NDK), although Java is the primary/preferred language for programming Android, and your C++ code will likely have to interface with Java components, and you'll likely need to read and understand the documentation for Java components, as well. Therefore, I'd advise you to use Java unless you have some existing C++ code base that you need to port and that isn't practical to rewrite in Java.
Java is very similar to C++, I don't think you will have any problems picking it up... going from C++ to Java is incredibly easy; going from Java to C++ is a little more difficult, though not terrible. Java for C++ Programmers does a pretty good job at explaining the differences. Writing your Android code in Java will be more idiomatic and will also make the development process easier for you (as the tooling for the Java Android SDK is significantly better than the corresponding NDK tooling)
In terms of setup, Google provides the Android Studio IDE for both Java and C++ Android development (with Gradle as the build system), but you are free to use whatever IDE or build system you want so long as, under the hood, you are using the Android SDK / NDK to produce the final outputs.
You should look at MoSync too, MoSync gives you standard C/C++, easy-to-use well-documented APIs, and a full-featured Eclipse-based IDE. Its now a open sourced IDE still pretty cool but not maintained anymore.
You can take a look also at C++ Builder XE6, and XE7 supports android in c++ code, and with Firemonkey library.
http://www.embarcadero.com/products/cbuilder
Pretty easy way to start, and native code. But the binaries have a big size.
You can use the Android NDK, but answers should note that the Android NDK app is not free to use and there's no clear open source route to programming Android on Android in an increasingly Android-driven market that began as open source, with Android developer support or the extensiveness of the NDK app, meaning you're looking at abandoning Android as any kind of first steps programming platform without payments.
Note: I consider subscription requests as payments under duress and this is a freemium context which continues to go undefeated by the open source community.
There is more than one library for working in C++ in Android programming:
C++ - qt (A Nokia product, also available as LGPL)
C++ - Wxwidget (Available as GPL)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Since you 'should' learn C/C++ and as part of 'learn as much languages as possible', i decided to learn C++ in depth.
My OS is Windows and my question is should i re-install Linux as a dual boot to learn C++ on Linux?
Do i miss something if I develop in C++ only on the Windows platform?
(possible duplicate: https://stackoverflow.com/questions/1128050/best-operating-system-for-c-development-and-learning)
Doesn't really matter what platform you write your code on.
If you want to verify that your code is portable, you could install cygwin and gcc as well as visual studio.
Then you could compile with both compilers without having to dualboot
If your goal is simply to learn C++, it doesn't matter what platform you use because C++, as a general purpose programming language, is not platform-specific. You can learn standard C++ on any platform with a decent C++ compiler.
If you want to practice / test on Linux, you can simply create a virtual machine, for example with VirtualBox.
Do i miss something if I develop in
C++ only on the Windows platform?
Valgrind.
Not really if you don't use OS specific calls or libs.
If you are asking about IDEs, compilers etc, that's a metter of your preferences about it.
First of all, learning "as many languges as possible" is less important than learning at least one programming language in depth first.
In my view, you should learn programming on the platform than you are most familiar with. If you are not familiar with Linux and it's features yet, it's no use to start learning programming with it because you wouldn't know what to do. You can also expect the MS documentation to be a bit more consistent than the Linux docs.
Some more things to consider:
You should get a ready-to-use development environment like Eclipe or MS Visual C++ (Windows). Getting the "standard way" with text editor, makefiles, etc. to work is too hard for a beginner, especially on Windows.
If you are going to use .NET on Windows, you have to be aware that the language is slightly different from standard C++. The same is true for C++ Builder, etc. If you are using Visual C++ or an environment based on the GNU compiler, you can program standard C++.
You should try to use C++ standard APIs and libraries like the STL, not MS-proprietary libs, except if you want to stick to Windows.
As long as you stick with cross-platform libraries (e.g. the C++ Standard Library, the Boost C++ Libraries, and the Qt Framework), instead of using platform-specific calls (e.g. the WIN32 API), and also assuming you use a cross-platform build system (e.g. CMake), instead of a platform-specific system (e.g. Visual Studio), then it won't matter. That said, it is much easier to setup a C/C++ development environment on Linux than it is to setup the equivalent development environment on Windows. And, since Linux will not include the "windows.h" header, you will be less likely to invoke Windows-specific features if you develop on Linux.
I recommend that you stick with Windows for a while until you gain some familiarity with the language. Then you can switch to Linux if you like. I say this because on Windows you can use Visual Studio (the Express Edition can be downloaded for free). Its user friendliness will ease some of the pain caused by the initial hurdles when learning C++.
Eventually you should also learn the Linux/Unix way by using gcc, makefiles and an advanced editor like vi/emacs/whatever.. However, this by itself is already challenging stuff, so save it for later and learn C++ first.
If, in the process of learning C and C++, you want to see how the libraries and the system actually work, Linux is the obvious choice as you can take a look at the system's entire source code.
IMHO, that can be quite instructive.
Since with C++ alone you will not be doing much, you should use both OSs (and more) to understand what is available to you in terms of libraries, compilers and IDEs (even development philosophies vary from OS to OS), this is not really important on your first steps into C++, at that stage it is more important which compiler/IDE you select...
Zed above rightly points you out the virtual machine option, VirtualBox is great.
Personally I would advise to avoid using Visual Studio as your first IDE/Compiler, it will add increased complexity and attempt to brainwash you into .net at every chance it gets.
It will also make it hard for you later on to move to other setups...
Start with a simple text editor (Notepad++ on windows) and by using the command line for compilations.
Same question as I asked myself before started learning. That is should I have to have a dual boot? No. If you have installed VC++ with Visual studio you can use Visual Studio provided compiler and is easier to use also. Apart from this you can download and install Cygwin and make sure to check the gcc and its related components. You can launch CYGWIN just like your dos but it provides you UNIX environment to work with inside Windows environment. then just cd to the folder which contain .cpp, and compile using UNIX commands. Simple as that. Happy coding... (For the CPP enthusiasts who land here)...