I am working on a small text based game. It has the ability to ask you one question when you get it right it says Correct, when wrong gives your incorrect etc etc.
Now I've tryed putting in like another Question using a new function. Everytime I put in my prototype it seems not to able to understand it.
Main.cpp [code]//Coded and Created by: Andrew Kapaldo (8-29-08)
//Assisted by: Adam
//Text Based Game
include <iostream>
include <cstdlib>
include "quiz.h"
include "int.h"
include <stdlib.h>
include <windows.h>
using namespace std;
int main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10);
//Initialzation of Program
GameTitle();
I am working on a small text based game. It has the ability to ask you one question when you get it right it says Correct, when wrong gives your incorrect etc etc.
Now I've tryed putting in like another Question using a new function. Everytime I put in my prototype it seems not to able to understand it.
Main.cpp
[code]//Coded and Created by: Andrew Kapaldo (8-29-08)
//Assisted by: Adam
//Text Based Game
include <iostream>
include <cstdlib>
include "quiz.h"
include "int.h"
include <stdlib.h>
include <windows.h>
using namespace std;
int main()
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10);
//Initialzation of Program
GameTitle();
}
}
return 0;
}[/code]
int.h
[code]//Coded and Created by: Andrew Kapaldo (8-29-08)
//Assisted by: Adam
//This is for all the Header Titles for the system
ifndef INT_H
define INT_H
//Function name of Initlization
void GameTitle();
endif
[/code]
int.cpp
[code]//Coded and Created by: Andrew Kapaldo (8-29-08)
//Assisted by: Adam
//Initilization of the game
include <iostream>
include <cstdlib>
include "int.h"
using namespace std;
char int_game = 0;
void GameTitle()
{
cout << "********\n"
<< "***** Ever Life **\n"
<< "** Version 1 Test ****\n"
<< "********\n";
}[/code]
quiz.h
[code]//Coded and Created by: Andrew Kapaldo (8-29-08)
//Assisted by: Adam
//Quiz Header
ifndef QUIZ_H
define QUIZ_H
void QuizStart();
void QuizStart2();
endif
[/code]
quiz.cpp
[code]//Coded and Created by: Andrew Kapaldo (8-29-08)
//Assisted by: Adam
//This is using the funcitons that is declared in Quiz.h
include <iostream>
include <cstdlib>
include "quiz.h"
using namespace std;
char quiz_a = 0;
char quiz_b = 0;
void QuizStart(); void QuizStart2()
{
cout << "The quiz will start shortly!\n"
<< "\n"
<< "\n";
cout << "Who invented the lightbulb?\n"
<< "A: Ben Franklin\n"
<< "B: Thomas Edison\n"
<< "C: George Washington\n";
cin.get();
quiz_a = cin.get();
quiz_a = toupper(quiz_a);
if (quiz_a == 'A' || quiz_a == 'C')
{
cout << "Sorry incorrect!\n";
cin.get();
quiz_b = cin.get();
quiz_b = toupper(quiz_b);
if(quiz_b == 'A' || quiz_b == 'C')
{
cout << "Sorry incorrect!\n";
{
}
}
[/code]
Related
Code: code
That's a lot of code to wade through to find the problem you are talking about. How about you give us a short-cut by posting the Compile Log!?
Error messages are emitted to aid diagnosis of problems, why would you not help yourself by providing that information?
See also the "PLEASE READ BEFORE POSTING A QUESTION" thread.
Clifford