Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Difference between MS C++ and "normal" C++?

Difference between MS C++ and "normal" C++?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
13 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Megidolaon
    wrote on last edited by
    #1

    I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

    _ CPalliniC M G T 6 Replies Last reply
    0
    • M Megidolaon

      I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Microsoft simply provides certain extensions to the C++ standard. These extensions are MS specific and will work only with MS compilers and OSs. Don't worry about learning one over the other. They're almost the same.

      «_Superman_» I love work. It gives me something to do between weekends.

      1 Reply Last reply
      0
      • M Megidolaon

        I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        They are practically the same for almost all purposes. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • M Megidolaon

          I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

          M Offline
          M Offline
          Megidolaon
          wrote on last edited by
          #4

          Thanks. Though I noticed in MS C++ you cannot use cin/cout, the syntax for #include is different and strings are also handled differenty.

          CPalliniC T G 3 Replies Last reply
          0
          • M Megidolaon

            Thanks. Though I noticed in MS C++ you cannot use cin/cout, the syntax for #include is different and strings are also handled differenty.

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            Megidolaon wrote:

            Though I noticed in MS C++ you cannot use cin/cout,

            That's not true.

            Megidolaon wrote:

            the syntax for #include is different and strings are also handled differenty.

            That is, as well, not true. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            • M Megidolaon

              Thanks. Though I noticed in MS C++ you cannot use cin/cout, the syntax for #include is different and strings are also handled differenty.

              T Offline
              T Offline
              tyr2000
              wrote on last edited by
              #6

              i think cin/cout can be used in ms c++,once i tried.Maybe you didn't include the right head files.or some thing wrong with the name spaces

              K 1 Reply Last reply
              0
              • M Megidolaon

                I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

                G Offline
                G Offline
                grassrootkit
                wrote on last edited by
                #7

                When you say "MS" you are potentially targeting windows. It's totally different from standard C++. Though you get the standard C++ from MS compilers, MS C++ (in your terms) or VC++ (the right term) would mean more eg: Win32APIs, MFC etc all platform oriented. All these libraries/Frameworks make things on top of MS C++ compiler.If you develop apps using plain, Standard C++, you will be able to run it on any OS. Just a recompilation would do.

                1 Reply Last reply
                0
                • T tyr2000

                  i think cin/cout can be used in ms c++,once i tried.Maybe you didn't include the right head files.or some thing wrong with the name spaces

                  K Offline
                  K Offline
                  kamalesh82
                  wrote on last edited by
                  #8

                  You can certainly use any cin/cout in ms c++, .. u have to include iostream.

                  kamalesh

                  1 Reply Last reply
                  0
                  • M Megidolaon

                    Thanks. Though I noticed in MS C++ you cannot use cin/cout, the syntax for #include is different and strings are also handled differenty.

                    G Offline
                    G Offline
                    grassrootkit
                    wrote on last edited by
                    #9

                    Megidolaon wrote:

                    Though I noticed in MS C++ you cannot use cin/cout, the syntax for #include is different and strings are also handled differenty.

                    It's not that. In pre-standard C++, it would be like

                    #include <iostream.h>

                    After standardization its,

                    #include <iostream>

                    Moreover I can say you forgot to include "using namespace std".

                    T 1 Reply Last reply
                    0
                    • M Megidolaon

                      I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

                      T Offline
                      T Offline
                      toxcct
                      wrote on last edited by
                      #10

                      you are obviously totally confused. recent Microsoft C++ Compiler (above version 2003) are significantly closer to the standard C++ than previous ones. so you can write a totally standard C++ Application (say, under vi or notepad, why not), and compile it with any compiler. gcc would handle it, and VC++ as well. what makes you becoming non-standard C++ is by using compiler-specific commands, or non-portable libraries (such as Win32, MFC)... but remember that VC++ only provides extensions to the standard, so anything standard should work with a Visual C++ compiler. If it doesn't, you're probably doing it wrong (show your code about cin/cout/#include)...! However, as an example, the following is 100% standard C++:

                      #include <iostream>
                      #include <string>

                      void main(void) {
                      std::string strName = "";

                      // Getting the User Name
                      std::cout << "your name: ";
                      std::cin >> strName;
                      
                      // Saying Hi
                      std::cout << "Hello " << strName << " !" << endl;
                      

                      }

                      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                      modified on Monday, February 23, 2009 8:00 AM

                      1 Reply Last reply
                      0
                      • G grassrootkit

                        Megidolaon wrote:

                        Though I noticed in MS C++ you cannot use cin/cout, the syntax for #include is different and strings are also handled differenty.

                        It's not that. In pre-standard C++, it would be like

                        #include <iostream.h>

                        After standardization its,

                        #include <iostream>

                        Moreover I can say you forgot to include "using namespace std".

                        T Offline
                        T Offline
                        toxcct
                        wrote on last edited by
                        #11

                        grassrootkit wrote:

                        Moreover I can say you forgot to include "using namespace std".

                        yeah, but using prepending std:: is generally prefered (the using namespace command can lead to unresovled names and should be used with care...

                        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                        1 Reply Last reply
                        0
                        • M Megidolaon

                          I noticed that there are some differences between MS C++ and C++ that is used elsewhere, for example most tutorials available on the internet are in "normal" C++. Are the commands so differnt that you need to learn one or the other or are they similar enough that if you leanr one, you know both? I'm currently stuck in a class about MS C++ nad I don't have any poosibility to learn the "normal" C++. When I'm done (3 months) will I also be able to programm with the "normal" C++ or would I have to learn that again? If so, how long would it take (realistically) to switch from MS C++ to the "normal" one? Thanks in advance.

                          M Offline
                          M Offline
                          Megidolaon
                          wrote on last edited by
                          #12

                          Thanks.

                          you are obviously totally confused.

                          Yes, I was, but now I'm not anymore. :laugh: Almost all online tutorials I found were in standard C++ and never mentioned anything about VC++, so I assumed there'd be sigificant differences. Thus I never found that you need #include to make it work in VC++, I just tried it out and it works fine. Without that, I always got an error with using std;. As for other OS, it should be fine if I don't get too much into the MS specific libraries?

                          T 1 Reply Last reply
                          0
                          • M Megidolaon

                            Thanks.

                            you are obviously totally confused.

                            Yes, I was, but now I'm not anymore. :laugh: Almost all online tutorials I found were in standard C++ and never mentioned anything about VC++, so I assumed there'd be sigificant differences. Thus I never found that you need #include to make it work in VC++, I just tried it out and it works fine. Without that, I always got an error with using std;. As for other OS, it should be fine if I don't get too much into the MS specific libraries?

                            T Offline
                            T Offline
                            toxcct
                            wrote on last edited by
                            #13

                            Megidolaon wrote:

                            Thus I never found that you need #include to make it work in VC++, I just tried it out and it works fine. Without that, I always got an error with using std;.

                            becasue you probably used it badly. can you post a code sample of a "not compiling" code, and the associated error ? We'll tell you what's wrong then...

                            Megidolaon wrote:

                            As for other OS, it should be fine if I don't get too much into the MS specific libraries?

                            As far as you do command line applications, everything will be ok. unfortunately, as soon as you start a windowed application, you'll have to choose a graphical library, which is most of the time OS-specific... But you know, it's not a bad choice sometimes to move a little from the standard C++ paths, especially for things that are anyway specifics to the OS. But for the logical layers, all depends on what systems you target, but I personnally prefer staying standard as much as I can...

                            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups