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. Back to basics; just started learnin C++

Back to basics; just started learnin C++

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studioc++com
11 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello, been using C# and vb.net and decided it's about time to make the leap to C++. I got a book recommended to me by a co worker entitled "Simple C++; learn C++ while you build the Incredible Robodog using POOP - The profound Object-Oriented Programming method" by Jeffrey M. Cogswell. I'm fine with this before I go onto something a little more detailed, and I have some pretty basic questions that a book written a decade ago just can't tackle. Firstly, a compiler. Which one do I use, I prefer something integrated with an IDE. Now I know VS has VC++, is this compiler only for C++.Net (which is managed I know, and I want to stay away from managed code for a bit). Recommendations, anything welcome.

    Check out the CodeProject forum Guidelines[^]

    P E 2 Replies Last reply
    0
    • L Lost User

      Hello, been using C# and vb.net and decided it's about time to make the leap to C++. I got a book recommended to me by a co worker entitled "Simple C++; learn C++ while you build the Incredible Robodog using POOP - The profound Object-Oriented Programming method" by Jeffrey M. Cogswell. I'm fine with this before I go onto something a little more detailed, and I have some pretty basic questions that a book written a decade ago just can't tackle. Firstly, a compiler. Which one do I use, I prefer something integrated with an IDE. Now I know VS has VC++, is this compiler only for C++.Net (which is managed I know, and I want to stay away from managed code for a bit). Recommendations, anything welcome.

      Check out the CodeProject forum Guidelines[^]

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      EliottA wrote:

      is this compiler only for C++.Net

      It can be used for unmanaged(only) code as well.

      1 Reply Last reply
      0
      • L Lost User

        Hello, been using C# and vb.net and decided it's about time to make the leap to C++. I got a book recommended to me by a co worker entitled "Simple C++; learn C++ while you build the Incredible Robodog using POOP - The profound Object-Oriented Programming method" by Jeffrey M. Cogswell. I'm fine with this before I go onto something a little more detailed, and I have some pretty basic questions that a book written a decade ago just can't tackle. Firstly, a compiler. Which one do I use, I prefer something integrated with an IDE. Now I know VS has VC++, is this compiler only for C++.Net (which is managed I know, and I want to stay away from managed code for a bit). Recommendations, anything welcome.

        Check out the CodeProject forum Guidelines[^]

        E Offline
        E Offline
        Eytukan
        wrote on last edited by
        #3

        Check here[^] Choose "win32" in the "project type" window then select "win32 Console application". Though you can still control the exe type through project settings. It's native by default. If you want to completely get out of dotnet environment, choose vc6.0 compiler that comes with Visual Studio 6.0 but the environment sucks. Intellisense fails too often. and less colorful ;)


        OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

        L 1 Reply Last reply
        0
        • E Eytukan

          Check here[^] Choose "win32" in the "project type" window then select "win32 Console application". Though you can still control the exe type through project settings. It's native by default. If you want to completely get out of dotnet environment, choose vc6.0 compiler that comes with Visual Studio 6.0 but the environment sucks. Intellisense fails too often. and less colorful ;)


          OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          The reason I ask is because I tried that, and the project came with some headers and I removed them all and created the typical first program

          #Include <iostream.h>

          void main
          {
          cout << "Hello, world";
          }

          And It wouldn't compile citing "Error 1 fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? c:\documents and settings\elaintabi\my documents\visual studio 2008\projects\helloworld\helloworld\helloworld.cpp 7 helloWorld" because I removed stdafx.h and the include, why do I need this file if in my book it doesn't include it in its sample?

          Check out the CodeProject forum Guidelines[^]

          T 1 Reply Last reply
          0
          • L Lost User

            The reason I ask is because I tried that, and the project came with some headers and I removed them all and created the typical first program

            #Include <iostream.h>

            void main
            {
            cout << "Hello, world";
            }

            And It wouldn't compile citing "Error 1 fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? c:\documents and settings\elaintabi\my documents\visual studio 2008\projects\helloworld\helloworld\helloworld.cpp 7 helloWorld" because I removed stdafx.h and the include, why do I need this file if in my book it doesn't include it in its sample?

            Check out the CodeProject forum Guidelines[^]

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

            this is because you might have started a project from a template or something. just deactivate the precompiled headers in the compiler settings to have this error disappeard. BTW, be careful. #include is with a small i, not #**I**nclude. Moreover, you should prefer using iostream (without .h) header. also, you code won't work for some other reasons. cout won't be found in the global namespace. just prepend it with std::. and main is a function, so you have to give it a pair or parenthesis:

            #include <iostream>

            void main() {
            std::cout << "Hello World !";
            }

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

            L 1 Reply Last reply
            0
            • T toxcct

              this is because you might have started a project from a template or something. just deactivate the precompiled headers in the compiler settings to have this error disappeard. BTW, be careful. #include is with a small i, not #**I**nclude. Moreover, you should prefer using iostream (without .h) header. also, you code won't work for some other reasons. cout won't be found in the global namespace. just prepend it with std::. and main is a function, so you have to give it a pair or parenthesis:

              #include <iostream>

              void main() {
              std::cout << "Hello World !";
              }

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

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Got it, thanks, I had to use #include "iostream" and fully qualify cout using std::cout, which is slightly annoying but it work sso i feel better about it hahah

              Check out the CodeProject forum Guidelines[^]

              T 1 Reply Last reply
              0
              • L Lost User

                Got it, thanks, I had to use #include "iostream" and fully qualify cout using std::cout, which is slightly annoying but it work sso i feel better about it hahah

                Check out the CodeProject forum Guidelines[^]

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

                EliottA wrote:

                fully qualify cout using std::cout, which is slightly annoying

                well beginners often fell std:: namespace annoying, but when going further in the experience, you kinda love it :-D In fact, you could declare a using namespace std; befoire the main() call and use only cout, but it's prefered to have the namespace prepended (and "std" is not what i'd call a loooooong name ;) )

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

                L 1 Reply Last reply
                0
                • T toxcct

                  EliottA wrote:

                  fully qualify cout using std::cout, which is slightly annoying

                  well beginners often fell std:: namespace annoying, but when going further in the experience, you kinda love it :-D In fact, you could declare a using namespace std; befoire the main() call and use only cout, but it's prefered to have the namespace prepended (and "std" is not what i'd call a loooooong name ;) )

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

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Book didn't specify that, but google did. TY for the help, 5's all around.

                  Check out the CodeProject forum Guidelines[^]

                  E 1 Reply Last reply
                  0
                  • L Lost User

                    Book didn't specify that, but google did. TY for the help, 5's all around.

                    Check out the CodeProject forum Guidelines[^]

                    E Offline
                    E Offline
                    Eytukan
                    wrote on last edited by
                    #9

                    Also did you get the precomplied header error?That's a technique VC++ applies to keep people away from it. LOL! it gives that stupid pch error on compilation and discourages people. Dont get deceived by it.. :). Also when you choose the project type next time, you may select "Add common headers-MFC" radio that you will find on the right side when are going through the project wizard. That sets up namespace for stl & required headers for MFC, in case you'd want to test MFC classes too. Good luck ;)


                    OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

                    L 1 Reply Last reply
                    0
                    • E Eytukan

                      Also did you get the precomplied header error?That's a technique VC++ applies to keep people away from it. LOL! it gives that stupid pch error on compilation and discourages people. Dont get deceived by it.. :). Also when you choose the project type next time, you may select "Add common headers-MFC" radio that you will find on the right side when are going through the project wizard. That sets up namespace for stl & required headers for MFC, in case you'd want to test MFC classes too. Good luck ;)


                      OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      right now, I'm just trying to code a dog. :laugh:

                      Check out the CodeProject forum Guidelines[^]

                      E 1 Reply Last reply
                      0
                      • L Lost User

                        right now, I'm just trying to code a dog. :laugh:

                        Check out the CodeProject forum Guidelines[^]

                        E Offline
                        E Offline
                        Eytukan
                        wrote on last edited by
                        #11

                        EliottA wrote:

                        right now, I'm just trying to code a dog.

                        Then I'd suggest VB. You dont need to code. It's already there. it's just that.


                        OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

                        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