Note that there are some explanatory texts on larger screens.

plurals
  1. POerror C2143: syntax error : missing ';' before 'constant'
    primarykey
    data
    text
    <p>Hi i am trying to use microsofts visual studio 2010 to make a text based game the only problem is when i made some functions it gave me this error when i wanted to run it error C2143: syntax error : missing ';' before 'constant' i can't figure it out. here is the script this is in c++</p> <pre><code>// Text Game.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include &lt;stdlib.h&gt; void ShowIntroduction ( void ) { printf( "Hello welcome to this text-based adventure game.\n" ); printf( "In this adventure game we will run into many difficult situations\n" ); printf( "1. A situation will present it's self\n" ); printf( "2. You will be given some choices.\n" ); printf( "3. You will need to make some choices.\n" ); printf( "4. The result of your choice will be shown.\n" ); } void ShowSituation1 ( void ) { printf( "\n\nYou are walking down a loney, dusty road.\n" ); printf( "When you see a gem on the ground.\n" ); printf( "It is bright and shiny!!\n" ); } void ShowSituation2 ( void ) { printf( "\n\nThe cave entrance looks inviting.\n" ); printf( "You are tempted to enter.\n" ); printf( "It looks kind of dark.\n" ); } void ShowSituation3 ( void ) { printf( "\nDo you want to keep going?\n" ); } void ShowChoices1 ( void ) { printf( "\nHere are your choices\n" ); printf( "1. Pick up the gem.\n"); printf( "2. Kick the gem off the road.\n" ); printf( "3. Stomp on the gem.\n" ); } void ShowChoices2 ( void ) { printf( "\nHere are your choices.\n" ); printf( "1. Run away\n" ); printf( "2. Take a nap.\n" ); printf( "3. Slowly enter the cave.\n" ); } void ShowChoices3 ( void ) { printf( "\n1. Ya I ain't scared.\n" ); printf( "2. No I need my mommy.\n" ); } int GetChoice ( int min, int max) { int Choice; do { printf( "Your choice? " ); scanf( "%d", &amp;Choice ); } while( Choice &lt; min || Choice &gt; max ); return( Choice ); } void ShowResults1 ( int Choice ) { if( Choice == 1 ) { printf( "\nYou pick up the gem and put it in your backpack.\n" ); printf( "You start walking down the road when you see smoke coming from your backpack.\n" ); printf( "Quickly you throw your bag off and jump down the hill just in time to escape the explosin from your bag.\n" ); printf( "You continue to roll down the hill, when you finally stop you get up and find a cave.\n" ); } else if( Choice == 2 ) { printf( "\nThe gem flys off the road.\n" ); printf( "You decide to see if you can find where it landed.\n" ); printf( "When you reach the bottom you notice a cave.\n" ); } else if( Choice == 3 ) { printf( "\nThe gem sends you sky high.\n" ); printf( "You hope that your health insurance is up to date.\n" ); printf( "Lucky for you it was a nice grassy hill you landed on.\n" ); printf( "You stand up to figure out where you are.\n" ); printf( "You notice a cave.\n" ); } else { printf( "\nThat wasn't a Choice you bozo.\n" ); printf( "You are dead now!!\n" ); exit (0); } } void ShowResults2 ( int Choice ) { if( Choice == 1 ) { printf( "\nWhat a chicken.\n" ); printf( "Looks like you need your mommy.\n" ); exit 0; } else if( Choice == 2 ) { printf( "\nIt is night time when you awake.\n" ); printf( "You get up and start walking but don't make it far.\n" ); printf( "You were attacked by a pack of wolves.\n" ); exit 0; } else if( Choice == 3 ) { printf( "You enter the cave slowly.\n" ); printf( "Your only light sorce is a lighter in your pocket.\n" ); printf( "You find a torch on the wall, you get the torch lit.\n" ); } else { printf( "\nThat wasn't a Choice you bozo.\n" ); printf( "You are dead now!!\n" ); exit (0); } } void ShowResults3 ( int Choice ) { if( Choice == 1 ) { printf( "\nYou decide to keep going.\n" ); } else if( Choice == 2 ) { printf( "\nWhat a pussy you are!!\n" ); exit 0; } else { printf( "\nThat wasn't a Choice you bozo.\n" ); printf( "You are dead now!!\n" ); exit (0); } } int _tmain(int argc, _TCHAR* argv[]) { int Choice; ShowIntroduction (); ShowSituation1 (); ShowChoices1 (); Choice = GetChoice ( 1,3 ); ShowResults1 ( Choice ); ShowSituation2 (); ShowChoices2 (); Choice = GetChoice ( 1,3 ); ShowResults2 ( Choice ); ShowSituation3 (); ShowChoices3 (); Choice = GetChoice ( 1,3 ); ShowResults3 ( Choice ); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload