Thread: IDE

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    2

    IDE

    Hi,

    Im using a tutorial CD to learn C++ and I have downloaded the miscrosoft express c plus plus 2008. However, it is not the same as what the guy is using in the tutorial Im following (he is using 2005) nor does he explain (or anyone else on the i-net I can find) just how to do the basics.

    For example, when I want to enter some of the sample code from the tutorial how do I go about this. ie) When I click on "New" then "Project" there are 3 options which do I choose. Then depending on which I choose there are more options which I do not understand.

    Please Help. thank u

  2. #2
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Im guessing you are using basic programming concepts.

    You would need:

    "Create New Project" -> "Win32 Project" ( then name it ) -> Hit OK -> "Next"-> Click on "Console application then click "Empty project" as this gets rid of the annoying pre-defined headers. Then click "Finish"and VC++ will create your project for you, allowing you to add files to it. I highly advise the first thing you add is a .cpp source file and name it "main"
    Double Helix STL

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Note that while swgh says PCH is annoying, I'd say the contrary.
    You don't need to create an empty project, either. VC will automatically generate code for you so you can start writing code directly.

    The PCH issue is a matter of discussion around here, and all I can say is that you should decide what you prefer. PCH speeds up compilation by "precompiling" headers.
    All you do is put all common includes inside the stdafx.h file.
    The downside is that you must put #include "stdafx.h" in every source file.

    While PCH may not be required for small projects, I say there's no harm in trying and is good experience if you want to do larger projects.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> The PCH issue is a matter of discussion around here
    And virtually everybody but Elysia says to turn them off for your simple learning applications.

    Checking the Empty Project box will save you a lot of hassle. It will also save people helping you on forums a lot of hassle because they won't have to do extra work to get your programs to compile if they want to help you.

    If you want to learn how to do big projects in VC++ later on you'll have plenty of time to learn pre-compiled headers. Until then leave them off.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Daved View Post
    Until then leave them off.
    And that is exactly why I disagree. PCH is not a hassle and you are explicitly denying people from using them while they do not cause harm. Therefore I always recommend experimenting and seeing what they do feel best.
    Who are we to judge for them?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    They are a hassle. Why? Because if you turn them off then there is nothing else you have to do. If you turn them on, you have to make sure you #include "stdafx.h" first in every source file, you have to make sure you include the stdafx.h and stdafx.cpp files with your code if you move it around, and people helping you on forums won't be able to compile the code you post without modifying it or creating their own stdafx.h file.

    If you prefer to call them extra unnecessary work rather than a hassle, that's fine. That doesn't make it ok to recommend people use them when they are first starting.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Who are we to judge for them?
    We are the people who have been on this board for years and have seen problems caused for newbies by PCHs quite regularly.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Daved View Post
    If you prefer to call them extra unnecessary work rather than a hassle, that's fine. That doesn't make it ok to recommend people use them when they are first starting.
    On the other hand, it does not give us the right to tell them they are evil, should be avoided or are a pain, etc. Recommend not using PCH instead because they may be problematic.
    Besides that, creating an empty project is not the only way not to generate PCH either and a non-empty project is not a bad thing either.
    (And I will still disagree on that they are bad. One simple include in every source is not much of a hassle and a quick lesson, not a big headache reason to avoid PCH.)
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    While PCH may not be required for small projects, I say there's no harm in trying and is good experience if you want to do larger projects.
    I agree, but only after the beginner becomes a novice who is able to recognise common standard headers and is not confused by the lack of precompiled headers.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User
    Join Date
    May 2008
    Posts
    2
    Wow, I didnt know that querstion would cause such debate. Thanks salem for your guide. Very helpful.

    Can anyone tell me what are the different methods availble for causing the console window to stay open.

    I already know
    Code:
    system ("pause")
    Are there any other lines of code which would perform the same operation (out of curiosity)?

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There are many.
    For C++, cin.get() is a typical way.
    Another is to rely on a GUI that can keep the console window open after the program finishes (Code::Blocks and Visual Studio are two).
    And yet another way is to put a breakpoint at the end of the function and use a debugger (very easy with Visual Studio).
    Then there's the C way, which is typically getchar().
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. IDE
    By djnorthyy in forum C++ Programming
    Replies: 6
    Last Post: 03-31-2008, 11:56 AM
  2. CBoard IDE of the year
    By cboard_member in forum A Brief History of Cprogramming.com
    Replies: 30
    Last Post: 12-09-2005, 07:50 AM
  3. 2 hdd, 1 ide
    By ElubHsif in forum Tech Board
    Replies: 6
    Last Post: 06-12-2005, 11:44 AM
  4. motherboard has 2 IDE socket?
    By beely in forum Tech Board
    Replies: 16
    Last Post: 10-30-2002, 10:55 PM
  5. HD on IDE 2
    By W.Churchill in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 03-13-2002, 08:53 PM