Solved

default code in Visual C++ 2008 Express

Posted on 2008-11-01
10
984 Views
Last Modified: 2013-12-16
Starting a new Console Application project in Visual C++ 2008 Express Edition creates the following code:
// boggs1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
      return 0;
}

How can I change this default?
0
Comment
Question by:highwray
  • 6
  • 4
10 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22858365
Silly question one my part - Why?
There is nothing that makes sense to remove from that code.  It is a safe default for you to build upon.
0
 

Author Comment

by:highwray
ID: 22858380
I am a very new begginner and I would like to have a default that agrees with the book I am learning from (SAMS Teach yourself C++ 2008 edition)
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22858424
What you want is possible but I haven't ever tried it and it is probably a lot more work than you would care for.

Simplest is for you to make a copy of that default code in a txt file somewhere.
Once you make a new project just copy/paste the default you want over that made by the wizard.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:highwray
ID: 22858450
Thank you for your advice.  It is just frustrating to have to change it every time I start.  I also (apparently) need to add "char response;   cin >> response;" before the final "return 0;" so that it stops when I test the code I am learning.
I had hoped there was a file somewhere that contained this default code or perhaps an option somewhere to change it.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22858463
Possible alternative - likely further in the book when you meet debugging tools/options.
In debug mode you could put a breakpoint on the 'return' line (Press the F9 key when the cursor is on that line).  The program will then halt at that line when being run from the debugger.  (Press F5 key when in the debugger to continue)
0
 

Author Comment

by:highwray
ID: 22858478
I see what you are getting at but I do not feel that that is the sort of solution I want.  All I hope to do is to edit the default code as necessary.
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 500 total points
ID: 22858508
OK, there is a way, I just don't know how.  (And it probably isn't so easy to do safely)
0
 

Author Comment

by:highwray
ID: 22858522
I do appreciate your help but I'm the sort of idiot that will spend hours to find an answer just for the fun, and satisfaction, of finding it.  I'll plod on and if I find a solution I'll let you know.  Having looked at your profile, though, I doubt that will be necessary.

Thanks again for you help (I've reached page 56 fairly easily so far.)
Regards
Michael
0
 

Accepted Solution

by:
highwray earned 0 total points
ID: 22858870
OK!  I've found it.  It is file root.cpp and on my laptop it is in folder "C:\Program Files\Microsoft Visual Studio 9.0\VC\VCWizards\AppWiz\Generic\Application\templates\1033\"


0
 

Author Comment

by:highwray
ID: 22859133
closed
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question