473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

What type of project for a simple program to run in a DOS window

I want to compile a simple c program.
Not c++ Not even Windows.

Just a simple program to run in a DOS window.

In vs2005 what type of project to I use.

I can't get started. I tried a couple of types but the wizard always
produces more then I need.

Thanks

What is the #include "stdafx.h" that keeps showing up for?
Feb 16 '06 #1
6 1412
>I want to compile a simple c program.
Not c++ Not even Windows.

Just a simple program to run in a DOS window.

In vs2005 what type of project to I use.

I can't get started. I tried a couple of types but the wizard always
produces more then I need.

Thanks

What is the #include "stdafx.h" that keeps showing up for?


with visual studio 2005, you can have to select a programming language in
either C#, VB.NET, C++ or J#.

if you got a file StdAfx.h, you selected a C++ project. StdAfx.h is the
default header file that will be compiled into a precompiled header for you.
the intention is that you put all the windows and library header in here if
they are needed in your project. they are compiled only once, instead of
each time you compile a cpp file. in your different cpp files you have to
include StdAfx.h.
this saves you a lot of compilation time.

StdAfx .cpp and .h are generated by default, and there is no harm in using
them.
you normally have console.cpp (or whatever your project name is) StdAxf.cpp,
StdAxf.h.
you can throw away the StdAfx files if you really want to.
in that case you also need to change the project properties to not use
precompiled headers

The simplest programs you can write are console applications. if you like
the C syntax you can choose between C# console applications and C++ console
applications.
with C# you always have to use .NET. with C++ you can choose to either use
the .NET framework or compile a native application.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 16 '06 #2

with C++ you can choose to either use the .NET framework or compile a
native application.

I don't see where I get this choice.
Testing I created (a few times) a C++ console project and never saw a chance
to pick one of these.
Thanks for replying
Feb 16 '06 #3
>> with C++ you can choose to either use the .NET framework or compile a
native application.
I don't see where I get this choice.
Testing I created (a few times) a C++ console project and never saw a
chance to pick one of these.


in VC2005, you select File->new->project. then:
under the Visual C++ option, you can select
win32 -> win32 console application: this option generates a project for a
native C++ console application.
or
CLR -> CLR console appliction: this option generates a project for a C++/CLI
console project that uses the .NET framework. CLR stands for Common Language
Runtime.
Thanks for replying

you're welcome.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 16 '06 #4
academic wrote:
with C++ you can choose to either use the .NET framework or compile a
native application.


I don't see where I get this choice.
Testing I created (a few times) a C++ console project and never saw a chance
to pick one of these.
Thanks for replying


In VS2003, choose Win32 Console Project. On the final page of the
wizard, you will see "Application Settings" on the left; if you click it
you will see a bunch of check boxes and radio buttons. One of them
allows you to pick "Empty project". Now you will not have "stdafx.h",
and you can simply add .c files to the project.

HTH,

David Wilkinson
Feb 16 '06 #5
Great, that clears it up.
thanks

"Bruno van Dooren" <br**********************@hotmail.com> wrote in message
news:eU**************@TK2MSFTNGP10.phx.gbl...
with C++ you can choose to either use the .NET framework or compile a
native application.

I don't see where I get this choice.
Testing I created (a few times) a C++ console project and never saw a
chance to pick one of these.


in VC2005, you select File->new->project. then:
under the Visual C++ option, you can select
win32 -> win32 console application: this option generates a project for a
native C++ console application.
or
CLR -> CLR console appliction: this option generates a project for a
C++/CLI console project that uses the .NET framework. CLR stands for
Common Language Runtime.
Thanks for replying

you're welcome.

--

Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"

Feb 16 '06 #6
Can't believe all the help I've received about this.

Thanks

"David Wilkinson" <no******@effisols.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
academic wrote:
with C++ you can choose to either use the .NET framework or compile a
native application.


I don't see where I get this choice.
Testing I created (a few times) a C++ console project and never saw a
chance to pick one of these.
Thanks for replying


In VS2003, choose Win32 Console Project. On the final page of the wizard,
you will see "Application Settings" on the left; if you click it you will
see a bunch of check boxes and radio buttons. One of them allows you to
pick "Empty project". Now you will not have "stdafx.h", and you can simply
add .c files to the project.

HTH,

David Wilkinson

Feb 16 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris Cioffi | last post by:
I started writing this list because I wanted to have definite points to base a comparison on and as the starting point of writing something myself. After looking around, I think it would be a...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
8
by: Chris Smith | last post by:
Experience posters, I am an experienced vb/vb.net developer but having a bit of trouble converting a bit of code to C#. I have 3 projects in one solution. Trying to create a plug-in type...
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
7
by: pvdg42 | last post by:
When we use Visual Studio in beginning C++ classes, we routinely follow the scenario below. Create a Win 32 Console Project (empty). Add a C++ source code file to the project.
8
by: Connectcase | last post by:
Hi there, and greetings from the Netherlands. Trying to switch over from VB to VB.NET and struggling with something that seemed very simple: ============================ Public Class Form1...
6
by: JonathanOrlev | last post by:
Hello everyone, I have a newbe question: In Access (2003) VBA, what is the difference between a Module and a Class Module in the VBA development environment? If I remember correctly, new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.