Code:
#include <stdio.h>
//#include <stdlib.h>
//#include <iostream.h>
#include <string.h>
#include <conio.h>
struct options
{
char newgame[]="NEW GAME";
char loadgame[]="LOAD GAME";
char options1[]="OPTIONS";
}
int option_loc[3];
option_loc[0]=&options.newgame;
option_loc[1]=&options.loadgame;
option_loc[2]=&options.options1;
function scrollmenu();
int choice=1;
int input=0;
int takein;
{
while (input!=1)
{
cls;
cout<<*option_loc[choice-1]<<*option_loc[choice]<<*option_loc[choice+1];
getch(takein);
if (takein==6) {choice+=1;}
if (choice==3) {choice=0;}
if (takein==4) {choice-=1;}
if (choice==-1) {choice=2;}
}
int main();
{
scrollmenu();
return 0;
}
The two commented out libraries are as such because the compiler was complaining about them being antiquated. What is wrong with this code?