Thread: C++

  1. #1
    ___
    Join Date
    Jun 2003
    Posts
    806

    C++

    Well after recently discovering that I can skip C and move to C++ which I was intending to go after I am doing it. But as for windows programming what is the difference in Visual C++ and C++ ?
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  2. #2
    Registered User Dohojar's Avatar
    Join Date
    Feb 2002
    Posts
    115
    C++ is a programming language. Visual C++ is a development tool from microsoft used to write C++ programs.
    Dohojar Moajbuj
    Time is the greatest teacher, too bad it kills all its students

  3. #3
    ___
    Join Date
    Jun 2003
    Posts
    806
    OK. So I could get a Visual C++ book learn it and then what i learned would essentially be C++?
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  4. #4
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278
    Yes. I recommend this book: Beginning Visual C++ 6 by Ivor Horton

    Although, you do not need a Visual C++ environment to learn C++ from this book. It explains specifics about the Visual C++ environment, but you can skip those parts if you are using another compiler (it is only explained to make it easier for a person who has Visual C++ to use it). It will have no effect on your learning C++ from the book.

    The 1st half of the book teaches C++. The second half gets into MFC, which you can skip, unless you wish to dive into it (I recommend learning the Win32 API before that, though).

  5. #5
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    I also strongly recommend that book, if you can handle it. If you're interested enough, you will. If you aren't, you'll fall asleep. He's not an interesting writer - he's a technical one.
    Away.

  6. #6
    ___
    Join Date
    Jun 2003
    Posts
    806
    Ok. Actually when I was starting C, I was reading his C book and I like him. Thanks for the help though
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  7. #7
    Student Forever! bookworm's Avatar
    Join Date
    Apr 2003
    Posts
    132
    Extremely sorry for changing the course of this thread,but since the members replying to this thread are well versed with C along with C++ too,I think it would be most appropriate to place my doubt here.
    I've read quite a lot of C++.Actually,C++ was the first C language I studied.However,in my next semester,there is a subject totally based on C.How different is C from C++,in refrence to syntax ,OOP capabilities etc.

  8. #8
    jasondoucette.com JasonD's Avatar
    Join Date
    Mar 2003
    Posts
    278
    Originally posted by bookworm
    Extremely sorry for changing the course of this thread,but since the members replying to this thread are well versed with C along with C++ too,I think it would be most appropriate to place my doubt here.
    I've read quite a lot of C++.Actually,C++ was the first C language I studied.However,in my next semester,there is a subject totally based on C.How different is C from C++,in refrence to syntax ,OOP capabilities etc.
    Basically, C++ is a superset of C, so C++ contains all of the functionality of C, and C contains only certain functionalities of C++. Here's a few quick points:

    1. There is no OOP in C. You can have structs as data types, which are basically classes that cannot contain functions - only data members (if you think of classes as data types, this is the easiest way to think about the connection).

    2. There is no type checking in C. You do not have to specifically type cast certain things, if the variables are the same size. This can introduce errors that C++ would normally complain about, preventing them going unnoticed.

    3. You cannot delcare variables whereever you wish in C. So, just before you need a loop counter, you cannot declare it right before it.

    I personally never use C, so there are probably many more important features missing that are included in C++. These are the major ones that pop into my head.

  9. #9
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Originally posted by JasonD
    Basically, C++ is a superset of C, so C++ contains all of the functionality of C, and C contains only certain functionalities of C++.
    Not technically true after C99; legal C code is not always legal C++ code anymore.

    C actually has support for a kind of OOP; the WinAPI can be used in C and is an example of this. It can't do OOP like C++ does (with classes), but you can use handle methods (like the WinAPI) to have the features of OOP.

    For example, you couldn't do:

    object.Method();

    but you can do:

    Method(handle);

    You can accomplish the primary aspects of OOP (data hiding, inheritance and polymorphism, etc.) through both mechanisms.

  10. #10
    ___
    Join Date
    Jun 2003
    Posts
    806
    Originally posted by JasonD
    Yes. I recommend this book: Beginning Visual C++ 6 by Ivor Horton
    1. Does it come with Visual C++ 6 or no?
    2. Also what do you guys think about Visual C++ 6 for Dummies?
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  11. #11
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Forget a book on VC++ at this point. Get a book on Winapi - Petzold's Programming Windows is about the best all rounder.

    I have books that concentrate on specialist facilities of VC++ (Programming Windows with MFC, Inside ATL), but they would put you at a disadvantage as you wouldnt have a good grasp on how windows apps work.

  12. #12
    ___
    Join Date
    Jun 2003
    Posts
    806
    ok... but can you answer my question
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  13. #13
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by ZakkWylde969
    ok... but can you answer my question
    The second post answered fine

    C++ is a programming language. Visual C++ is a development tool from microsoft used to write C++ programs.
    C++ is a language that works on many platforms and it also has a standard for compilers to comply with. The closer a compiler vendor complies, the easier it will be for someone to port their code to that compiler.

    VC++ doesnt comply too well to the standard (yet), but it is worth having for windows programming as it has certian features that other compilers may not (specific class libraries like ATL and MFC, esoteric features that work with windows itself - Structured Exception Handling, specialist tools like the MIDL compiler for creating typelibs and VC++ is the only c++ compiler that microsoft supports for building drivers (suprise suprise)). So if you are focussed on windows coding, VC++ is well worth having.

    Personally, I use VC++ when I want to work on something specific in windows, and codewarrior when I want something more generic and standard complient

  14. #14
    ___
    Join Date
    Jun 2003
    Posts
    806
    Sorry to say this but you posted an answer to a question I found out already. It was to this..

    quote:
    --------------------------------------------------------------------------------
    Originally posted by JasonD
    Yes. I recommend this book: Beginning Visual C++ 6 by Ivor Horton

    --------------------------------------------------------------------------------



    1. Does it come with Visual C++ 6 or no?
    2. Also what do you guys think about Visual C++ 6 for Dummies?
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  15. #15
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by ZakkWylde969
    1. Does it come with Visual C++ 6 or no?
    2. Also what do you guys think about Visual C++ 6 for Dummies?
    Oops..he he....

    1. I did get a small Ivor Horton book with VC++6 , but that was a long time ago and I'm not sure that it came with all editions. Also, I doubt you will get VC++6 anymore, more likely VC++.NET. Anyway, the book was only small - not enough to learn from. I discarded it and got Petzold.

    2. Wouldnt bother personally, go with Petzold. Try some review of books also - http://www.accu.org/bookreviews/publ...MS_Windows.htm

Popular pages Recent additions subscribe to a feed