Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

default code in Visual C++ 2008 Express

Posted on 2008-11-01
10
Medium Priority
?
990 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 45

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 45

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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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 45

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 45

Assisted Solution

by:AndyAinscow
AndyAinscow earned 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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…
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 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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses

783 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