Question:
ok i was wondering is there any way to "run" not write; im done writing the source code...anyways is there any?
Dylan
2010-12-18 16:25:11 UTC
way to "run" a C++ source file in Dreamweaver CS5 or Notepad++, i dont know if i missed something or if i have to save it a certain way but i want it to run in a CMD window...here is part of the code (beginning to bout middle):

// AdventureGame.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]}
{
int Choice;

printf( "Wecome to the coolest adventure game ever!!!\n\n");
printf( "In this adventure game we will experience a number of situations.\n" );
printf( "Each situation follows the same pattern for right now.\n" );
printf( "1. A situation will be presented.\n");
printf( "2. You will be given some choices.\n" );
printf( "3. You will be asked to make a choice.\n" );
printf( "4. The result of your choice will be shown.\n" );
printf( "Later we will add things to this program such as score and guessing games.\n" );

printf( "\n\nYou are walking down a dusty road.\n" );
printf( "You see a gemstone in the middle of the road.\n" );
printf( "It is bright and shiny.\n" );

printf( "Here are your coices:\n" );
printf( "1. Pick the gemstone up\n" );
printf( "2. Kick the gemstone off the road.\n" );
printf( "3. Stomp on the gemstone.\n" );

printf( "Your choice? " );
scanf( "%d", &Choice );

if( Choice == 1 )
{
printf( "You pick up the gemstone and put it in your backpack.\n" );
printf( "It becomes an incendarily ball of flame.\n" );
printf( "You drop to the ground and roll off the side of the road.\n" );
printf( "Your backpack is now a smoulder pile of ash.\n" );
printf( "You notice the entrance to a cave.\n" );
}
else if( Choice == 2 )
{
printf( "The gemstone skips off the road.\n" );
printf( "You follow the gemstone off the road to see where it went.\n" );
printf( "You notice the entrance to a cave.\n" );
}
else if( Choice == 3 )
{
printf( "The gemstone blows you sky high.\n" );
printf( "You hope your health insurance premiums are up to date.\n" );
printf( "You land on side of the road.\n" );
printf( "You notice the entrance to a cave.n" );
}
else
{
printf( "That was not a choice.\n" );
printf( "You are dead now, good job :P.\n" );
return 0;
}

i wrote this into Notepad++ (which can write many computer languages) as C++(language) and saved it as "AdventureGame.cpp" i jus want it to run can anyone help me please and thank you
and can u please provide me with a link for a free program tht i can use in the future to run these type programs...thanks again
Four answers:
Gardner
2010-12-18 17:08:19 UTC
Grab a freebie copy of Visual C++ at http://www.micsoft.com/express and you'll have a compiler.
?
2016-10-06 10:15:27 UTC
sturdy Morning CW- have not study or been effectual in the two section. If there is this variety of e book, in keeping with threat it grew to become into from the comparable author of "adult adult males are from Mars, women human beings are from Venus"- if that is even surprising. have not had a cup of java yet, so the concepts is in opposite, in basic terms slipped out of impartial.
2010-12-18 16:27:29 UTC
You need to compile it as a program. But it will never be able to run on any web page. (as in Dreamweaver)
2010-12-18 16:50:21 UTC
You download a compiler - Visual C++ and gcc will work.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...