Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-05-2005, 10:59 PM   #1 (permalink)
357mag
Registered User
 
Join Date: Mar 2005
Posts: 15
357mag is on a distinguished road
Can I delete the default code?

I'm thinking of picking up Visual C++.NET. I found out through someone else that when you start a new console project the program places this default code in the window:

#include stdafx.h

int _tmain(int argc, TCHAR* argv[])
{
return 0;
}

Now this is Microsoft specific stuff. I was wondering if I could delete all of it and just enter the basic C++ code that is outlined in my book which is this:

#include <iostream>
using namespace std;

int main( )
{
cout << "Hello There!";

return 0;
}

Now if I do that will the program still run? Or will the compiler start throwing error messages cuz I deleted that default code? I would prefer to delete that default code and just type in my code.
357mag is offline   Reply With Quote
Old 04-06-2005, 12:04 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
Sure, it's your program, you can decide what code it should consist of. Just delete what ever is placed in the editor, and start your own from scratch.

The default code it shows is just what it expects anyone, who dosn't know where to start, would be using for their program, since the editor itself isn't a mind reader, it can't provide the aprorpriate code for any situation.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 04-06-2005, 12:23 AM   #3 (permalink)
QUantumAnenome
Code Monkey
 
Join Date: Mar 2005
Posts: 56
QUantumAnenome is on a distinguished road
Send a message via Yahoo to QUantumAnenome
Depends...

There are many flavors of .net projects.
I always set my new console projects' parameters to "empty project". This will not generate any code for you.
If you just create a console project, (and do NOT choose the empty project parameter), and it does create some files for you, you cannot delete it all. The #include "stdafx.h" in the source, and the stdafx.h file itself must be there because pre-compiled headers are the default for non-empty projects. All source files for this project now must have this unless you changes the settings. I believe the rest you can delete.
QUantumAnenome is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Would you mind if there were small flash elements at code newbie? sde Lounge 10 05-29-2004 10:05 PM
Cisco Code breaking sde Code Newbie News 0 05-21-2004 08:10 AM
Microsoft probes Windows code leak redhead Code Newbie News 0 02-13-2004 01:41 AM
Mini Games Nitro PHP 18 11-11-2003 12:17 PM


All times are GMT -8. The time now is 08:30 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting