I am in a computer programming class at school and need some help on a a part of the program.
#include "DarkGDK.h"
void DarkGDK()
{
DWORD white = dbRGB(255, 255, 255);
DWORD black = dbRGB(0, 0, 0);
DWORD red = dbRGB(255, 0, 0);
char *FirstName;
char *MiddleInitial;
char *LastName;
char *YearBorn;
char *ThisYear;
char *Age;
dbInk(red, black);
dbPrint("Welcome to the age program!");
dbPrint("<Press any key to continue>");
dbWaitKey();
dbCLS();
dbPrint("Please enter your first name: ");
dbInk(white, black);
FirstName = dbInput();
dbInk(red, black);
dbPrint("Please enter you middle initial: ");
dbInk(white, black);
MiddleInitial = dbInput();
dbInk(red, black);
dbPrint("Please enter your last name: ");
dbInk(white, black);
LastName = dbInput();
dbInk(red, black);
dbPrint("Please enter the year you were born in: ");
dbInk(white, black);
YearBorn = dbInput();
dbInk(red, black);
dbPrint("Please enter what year it is: ");
dbInk(white, black);
ThisYear = dbInput();
dbCLS();
Age = ThisYear - YearBorn;
dbInk(red, black);
dbPrint("Hello");
dbPrint( FirstName );
dbPrint( MiddleInitial );
dbPrint( LastName );
dbPrint( "You were born in ");
dbPrint( YearBorn );
dbPrint( " and will be ");
dbPrint( Age );
dbPrint( " this year! ");
dbWaitKey();
}
Here is my code so far. I am having trouble with the part that says Age = ThisYear - YearBorn;
While trying to output the Age to the screen it keeps coming up with the error C2440 that says cannot convert from int to char *
Any ideas?