| View previous topic :: View next topic |
| Author |
Message |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Fri Oct 24, 2008 7:20 pm Post subject: How to make programs |
|
|
Say I wanted to make a program that says this:
| Code: | // my first program in C++
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
|
How would I do that? I don't have a clue what to do, although I know what the program does. I'm also using Microsoft Visual C++ Express Edition 2008 SP1.
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Oct 24, 2008 7:21 pm Post subject: |
|
|
| Compile and run it.
|
|
| Back to top |
|
 |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Fri Oct 24, 2008 7:22 pm Post subject: |
|
|
| slovach wrote: | | Compile and run it. |
But how? What kind of file/project would I open? Also, what would I put it in? A .h file or a .cpp file? I don't really know the difference between them.
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Oct 24, 2008 7:28 pm Post subject: |
|
|
Create an empty project.
Right click a folder in the tree view (preferably 'Source Files'), add a new cpp file.
Code whatever, compile, run.
|
|
| Back to top |
|
 |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Fri Oct 24, 2008 7:30 pm Post subject: |
|
|
| slovach wrote: | Create an empty project.
Right click a folder in the tree view (preferably 'Source Files'), add a new cpp file.
Code whatever, compile, run. |
Okay I'll try that. Thanks.
Uhh.. One more question, what kind of project would I use? There's a lot of ooptions, Class Library, CLR Empty Project, CLR Console Application, Windows Forms Application. There's more.. but I'm not sure xD
_________________
|
|
| Back to top |
|
 |
BirdsEye Advanced Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 94
|
Posted: Fri Oct 24, 2008 7:40 pm Post subject: |
|
|
| xViBeSz wrote: | | slovach wrote: | Create an empty project.
Right click a folder in the tree view (preferably 'Source Files'), add a new cpp file.
Code whatever, compile, run. |
Okay I'll try that. Thanks.
Uhh.. One more question, what kind of project would I use? There's a lot of ooptions, Class Library, CLR Empty Project, CLR Console Application, Windows Forms Application. There's more.. but I'm not sure xD |
For now I'd recommend to stick to Win32 projects. You can tell what type of project you should select by look at the entry point. This uses main( ) should it should be a Win32 console project. (A regular Win32 project would have WinMain( )) Header files are usually inserted to make the project more organized like you'd put your definitions or even declarations. A cpp file essentially contains your source code. It would contain what you have above, the entry point, variables, functions, and so on.
|
|
| Back to top |
|
 |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Fri Oct 24, 2008 7:45 pm Post subject: |
|
|
| BirdsEye wrote: | | xViBeSz wrote: | | slovach wrote: | Create an empty project.
Right click a folder in the tree view (preferably 'Source Files'), add a new cpp file.
Code whatever, compile, run. |
Okay I'll try that. Thanks.
Uhh.. One more question, what kind of project would I use? There's a lot of ooptions, Class Library, CLR Empty Project, CLR Console Application, Windows Forms Application. There's more.. but I'm not sure xD |
For now I'd recommend to stick to Win32 projects. You can tell what type of project you should select by look at the entry point. This uses main( ) should it should be a Win32 console project. (A regular Win32 project would have WinMain( )) Header files are usually inserted to make the project more organized like you'd put your definitions or even declarations. A cpp file essentially contains your source code. It would contain what you have above, the entry point, variables, functions, and so on. |
Okay, should I use Win32 Console App, or just plain Win32 Project?
Thanks for your help.
_________________
|
|
| Back to top |
|
 |
clanner Master Cheater
Reputation: 0
Joined: 26 Jul 2006 Posts: 290
|
Posted: Fri Oct 24, 2008 8:34 pm Post subject: |
|
|
| Console app is what you should use for that type of code.
|
|
| Back to top |
|
 |
xV I post too much
Reputation: 1
Joined: 03 Jan 2008 Posts: 3783 Location: Seattle
|
Posted: Fri Oct 24, 2008 8:37 pm Post subject: |
|
|
| clanner wrote: | | Console app is what you should use for that type of code. |
Oh thanks, I was using the other one..
_________________
|
|
| Back to top |
|
 |
|