Solved

default code in Visual C++ 2008 Express

Posted on 2008-11-01
10
988 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

622 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