Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,324 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,099 people online right now. Registration is fast and FREE... Join Now!




How to run the program

 
Reply to this topicStart new topic

How to run the program

asaljoha
post 13 Mar, 2008 - 12:20 PM
Post #1


New D.I.C Head

*
Joined: 27 Feb, 2008
Posts: 8

Hi,
I have problem when I want to run a program in visual studio 2005.
I want to run this program:

#include <iostream>

using namespace std;

#include "ccc_time.h"

int main()
{
const int SECONDS_PER_MINUTE = 60;

cout << "Enter the time your next assignment is due (hour min): ";
int hour;
int min;

cin >> hour >> min;

Time due_time(hour, min, 0);
Time now;

int diff = due_time.seconds_from(now) / SECONDS_PER_MINUTE;

cout << "The assignment is due in " << diff << " minutes." << "\n";

return 0;
}


what do I have to choose when I select new project ...add new item (choose code or win 32)...

User is offlineProfile CardPM

Go to the top of the page

MorphiusFaydal
post 13 Mar, 2008 - 05:01 PM
Post #2


D.I.C Lover

Group Icon
Joined: 12 May, 2005
Posts: 1,086



Thanked 8 times

Expert In: Hardware, Networking

My Contributions


File --> New --> Project

Project of type: Empty Project

In the Solution Explorer (panel on the right hand side), right click on Source files and say go Add --> New Item. You want C++ File (.cpp). Enter a name for it.

Paste your code into the editor.

Hit [u]Save[/b].

Now. To run it. Go to Debug --> Start without debugging. Alternately, you can hit Ctrl-F5.
User is offlineProfile CardPM

Go to the top of the page

asaljoha
post 14 Mar, 2008 - 01:02 AM
Post #3


New D.I.C Head

*
Joined: 27 Feb, 2008
Posts: 8

Thank you for your help but still the same problem I have.
When I enter debugging it says unable to start program.

I use #include "ccc_time.h" so I think there different way to run this program.
User is offlineProfile CardPM

Go to the top of the page

asaljoha
post 14 Mar, 2008 - 01:24 PM
Post #4


New D.I.C Head

*
Joined: 27 Feb, 2008
Posts: 8

so is there any way to run it (select win 31 or what)
User is offlineProfile CardPM

Go to the top of the page

MorphiusFaydal
post 14 Mar, 2008 - 01:42 PM
Post #5


D.I.C Lover

Group Icon
Joined: 12 May, 2005
Posts: 1,086



Thanked 8 times

Expert In: Hardware, Networking

My Contributions


I'm guessing ccc_time.h is a header of your own creation?

Add the header file and the corresponding source file to the project.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/22/08 02:40AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month