Solved

default code in Visual C++ 2008 Express

Posted on 2008-11-01
10
979 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
 

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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 use and create new code templates in NetBeans IDE 8.0 for Windows.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now